terminusdb 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Contributing.md +36 -0
- package/LICENSE +201 -0
- package/README.md +175 -0
- package/RELEASE_NOTES.md +462 -0
- package/dist/index.html +22 -0
- package/dist/terminusdb-client.min.js +3 -0
- package/dist/terminusdb-client.min.js.LICENSE.txt +188 -0
- package/dist/terminusdb-client.min.js.map +1 -0
- package/dist/typescript/index.d.ts +14 -0
- package/dist/typescript/lib/accessControl.d.ts +554 -0
- package/dist/typescript/lib/axiosInstance.d.ts +2 -0
- package/dist/typescript/lib/connectionConfig.d.ts +381 -0
- package/dist/typescript/lib/const.d.ts +54 -0
- package/dist/typescript/lib/dispatchRequest.d.ts +17 -0
- package/dist/typescript/lib/errorMessage.d.ts +25 -0
- package/dist/typescript/lib/query/woqlBuilder.d.ts +75 -0
- package/dist/typescript/lib/query/woqlCore.d.ts +341 -0
- package/dist/typescript/lib/query/woqlDoc.d.ts +63 -0
- package/dist/typescript/lib/query/woqlLibrary.d.ts +718 -0
- package/dist/typescript/lib/query/woqlPrinter.d.ts +71 -0
- package/dist/typescript/lib/query/woqlQuery.d.ts +833 -0
- package/dist/typescript/lib/typedef.d.ts +624 -0
- package/dist/typescript/lib/utils.d.ts +199 -0
- package/dist/typescript/lib/valueHash.d.ts +146 -0
- package/dist/typescript/lib/viewer/chartConfig.d.ts +62 -0
- package/dist/typescript/lib/viewer/chooserConfig.d.ts +38 -0
- package/dist/typescript/lib/viewer/documentFrame.d.ts +44 -0
- package/dist/typescript/lib/viewer/frameConfig.d.ts +74 -0
- package/dist/typescript/lib/viewer/frameRule.d.ts +145 -0
- package/dist/typescript/lib/viewer/graphConfig.d.ts +73 -0
- package/dist/typescript/lib/viewer/objectFrame.d.ts +212 -0
- package/dist/typescript/lib/viewer/streamConfig.d.ts +23 -0
- package/dist/typescript/lib/viewer/tableConfig.d.ts +66 -0
- package/dist/typescript/lib/viewer/terminusRule.d.ts +75 -0
- package/dist/typescript/lib/viewer/viewConfig.d.ts +47 -0
- package/dist/typescript/lib/viewer/woqlChart.d.ts +1 -0
- package/dist/typescript/lib/viewer/woqlChooser.d.ts +56 -0
- package/dist/typescript/lib/viewer/woqlGraph.d.ts +26 -0
- package/dist/typescript/lib/viewer/woqlPaging.d.ts +1 -0
- package/dist/typescript/lib/viewer/woqlResult.d.ts +128 -0
- package/dist/typescript/lib/viewer/woqlRule.d.ts +96 -0
- package/dist/typescript/lib/viewer/woqlStream.d.ts +31 -0
- package/dist/typescript/lib/viewer/woqlTable.d.ts +102 -0
- package/dist/typescript/lib/viewer/woqlView.d.ts +49 -0
- package/dist/typescript/lib/woql.d.ts +1267 -0
- package/dist/typescript/lib/woqlClient.d.ts +1216 -0
- package/index.js +28 -0
- package/lib/.eslintrc +1 -0
- package/lib/accessControl.js +988 -0
- package/lib/axiosInstance.js +5 -0
- package/lib/connectionConfig.js +765 -0
- package/lib/const.js +59 -0
- package/lib/dispatchRequest.js +236 -0
- package/lib/errorMessage.js +110 -0
- package/lib/query/woqlBuilder.js +234 -0
- package/lib/query/woqlCore.js +934 -0
- package/lib/query/woqlDoc.js +177 -0
- package/lib/query/woqlLibrary.js +1015 -0
- package/lib/query/woqlPrinter.js +476 -0
- package/lib/query/woqlQuery.js +1865 -0
- package/lib/typedef.js +248 -0
- package/lib/utils.js +817 -0
- package/lib/valueHash.js_old +581 -0
- package/lib/viewer/chartConfig.js +411 -0
- package/lib/viewer/chooserConfig.js +234 -0
- package/lib/viewer/documentFrame.js +206 -0
- package/lib/viewer/frameConfig.js +469 -0
- package/lib/viewer/frameRule.js +519 -0
- package/lib/viewer/graphConfig.js +345 -0
- package/lib/viewer/objectFrame.js +1550 -0
- package/lib/viewer/streamConfig.js +82 -0
- package/lib/viewer/tableConfig.js +310 -0
- package/lib/viewer/terminusRule.js +196 -0
- package/lib/viewer/viewConfig.js +219 -0
- package/lib/viewer/woqlChart.js +17 -0
- package/lib/viewer/woqlChooser.js +171 -0
- package/lib/viewer/woqlGraph.js +295 -0
- package/lib/viewer/woqlPaging.js +148 -0
- package/lib/viewer/woqlResult.js +258 -0
- package/lib/viewer/woqlRule.js +312 -0
- package/lib/viewer/woqlStream.js +27 -0
- package/lib/viewer/woqlTable.js +332 -0
- package/lib/viewer/woqlView.js +107 -0
- package/lib/woql.js +1693 -0
- package/lib/woqlClient.js +2091 -0
- package/package.json +110 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see terminusdb-client.min.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TerminusDBClient=e():t.TerminusDBClient=e()}(this,(()=>(()=>{var __webpack_modules__={6024(t,e,r){var n=r(9156),i=n.Var,o=n.Vars,s=n.Doc,a=r(266),u=r(4557),c=r(4773),h=r(7589),l=r(9297),p=r(106),f=r(686),d=r(805),y=r(4375),g=r(693);t.exports={Var:i,Doc:s,Vars:o,WOQLClient:a,UTILS:u,View:c,WOQL:h,WOQLResult:l,WOQLTable:p,WOQLGraph:f,axiosInstance:d,AccessControl:y,WOQLQuery:g}},4375(t,e,r){var n=r(3103),i=r(8139),o=r(47),s=r(4557);function a(t,e){this.baseURL=this.getAPIUrl(t),e&&(e.jwt?this.setJwtToken(e.jwt):e.token?this.setApiToken(e.token):e.key&&(this.setApiKey(e.key),this.user=e.user),this.defaultOrganization=this.getDefaultOrganization(e))}r(7135),a.prototype.getDefaultOrganization=function(t){if(t&&t.organization&&"string"==typeof t.organization)return t.organization},a.prototype.setJwtToken=function(t){if(!t)throw new Error("TerminusX Access token required");this.apiKey=t,this.apiType="jwt"},a.prototype.setApiToken=function(t){if(!t)throw new Error("TerminusX Access token required");this.apiKey=t,this.apiType="apikey"},a.prototype.setApiKey=function(t){if(!t)throw new Error("TerminusDB bacis authentication key required");this.apiKey=t,this.apiType="basic"},a.prototype.getAPIUrl=function(t){if(!t||"string"!=typeof t)throw new Error("TerminusX api url required!");return t.lastIndexOf("/")!==t.length-1&&(t+="/"),"".concat(t,"api")},a.prototype.dispatch=function(t,e,r){return t?n(t,e,r,{type:this.apiType,key:this.apiKey,user:this.user},null,this.customHeaders()):Promise.reject(new Error(i.getInvalidParameterMessage(e,"Invalid request URL")))},a.prototype.customHeaders=function(t){if(!t)return this._customHeaders;this._customHeaders=t},a.prototype.getOrganization=function(t){return this.dispatch("".concat(this.baseURL,"/organizations/").concat(t),o.GET)},a.prototype.getAllOrganizations=function(){return this.dispatch("".concat(this.baseURL,"/organizations"),o.GET)},a.prototype.createOrganization=function(t){return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(t)),o.POST,{})},a.prototype.deleteOrganization=function(t){return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(t)),o.DELETE)},a.prototype.createRole=function(t,e){var r={name:t,action:e};return this.dispatch("".concat(this.baseURL,"/roles"),o.POST,r)},a.prototype.deleteRole=function(t){return this.dispatch("".concat(this.baseURL,"/roles/").concat(s.encodeURISegment(t)),o.DELETE)},a.prototype.getAllUsers=function(){return this.dispatch("".concat(this.baseURL,"/users"),o.GET)},a.prototype.createUser=function(t,e){var r={name:t,password:e};return this.dispatch("".concat(this.baseURL,"/users"),o.POST,r)},a.prototype.deleteUser=function(t){return this.dispatch("".concat(this.baseURL,"/users/").concat(s.encodeURISegment(t)),o.DELETE)},a.prototype.manageCapability=function(t,e,r,n,i){var s={operation:n,user:t,roles:r,scope:e,scope_type:i};return this.dispatch("".concat(this.baseURL,"/capabilities"),o.POST,s)},a.prototype.getAccessRoles=function(){return this.dispatch("".concat(this.baseURL,"/roles"),o.GET)},a.prototype.getOrgUsers=function(t){if(!t&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("GET","Please provide a organization name")));var e=t||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(e),"/users"),o.GET)},a.prototype.getTeamUserRoles=function(t,e){if(!e&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("GET","Please provide a organization name")));var r=e||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(r),"/users/").concat(s.encodeURISegment(t)),o.GET)},a.prototype.ifOrganizationExists=function(t){return t?this.dispatch("".concat(this.baseURL,"/private/organizations/").concat(s.encodeURISegment(t)),o.HEAD):Promise.reject(new Error(i.getInvalidParameterMessage("HEAD","Please provide a organization name")))},a.prototype.createOrganizationRemote=function(t){var e={organization:t};return this.dispatch("".concat(this.baseURL,"/private/organizations"),o.POST,e)},a.prototype.getPendingOrgInvites=function(t){if(!t&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("GET","Please provide a organization name")));var e=t||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(e),"/invites"),o.GET)},a.prototype.sendOrgInvite=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;if(a||this.defaultOrganization?t?e||(r="Please provide a role"):r="Please provide a user email":r="Please provide a organization name",r)return Promise.reject(new Error(i.getInvalidParameterMessage("POST",r)));var u=a||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(u),"/invites"),o.POST,{email_to:t,role:e,note:n})},a.prototype.getOrgInvite=function(t,e){var r;if(e||this.defaultOrganization?t||(r="Please provide a invite id"):r="Please provide a organization name",r)return Promise.reject(new Error(i.getInvalidParameterMessage("POST",r)));var n=e||this.defaultOrganization,a=s.removeDocType(t);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(n),"/invites/").concat(a),o.GET)},a.prototype.deleteOrgInvite=function(t,e){var r;if(e||this.defaultOrganization?t||(r="Please provide a invite id"):r="Please provide a organization name",r)return Promise.reject(new Error(i.getInvalidParameterMessage("POST",r)));var n=e||this.defaultOrganization,a=s.removeDocType(t);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(n),"/invites/").concat(a),o.DELETE)},a.prototype.updateOrgInviteStatus=function(t,e,r){var n;if(r||this.defaultOrganization?t?void 0===e&&(n="Please provide a accepted status"):n="Please provide a invite id":n="Please provide a organization name",n)return Promise.reject(new Error(i.getInvalidParameterMessage("PUT",n)));var a=r||this.defaultOrganization,u=s.removeDocType(t);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(a),"/invites/").concat(u),o.PUT,{accepted:e})},a.prototype.getTeamUserRole=function(t){if(!t&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("GET","Please provide a organization name")));var e=t||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(e),"/role"),o.GET)},a.prototype.removeUserFromOrg=function(t,e){var r;if(e||this.defaultOrganization?t||(r="Please provide a userId"):r="Please provide a organization name",r)return Promise.reject(new Error(i.getInvalidParameterMessage("DELETE",r)));var n=e||this.defaultOrganization,a=s.removeDocType(t);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(n),"/users/").concat(a),o.DELETE)},a.prototype.getDatabaseRolesOfUser=function(t,e){var r;if(e||this.defaultOrganization?t||(r="Please provide a user id"):r="Please provide a organization name",r)return Promise.reject(new Error(i.getInvalidParameterMessage("GET",r)));var n=e||this.defaultOrganization,a=s.removeDocType(t);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(n),"/users/").concat(a,"/databases"),o.GET)},a.prototype.createUserRole=function(t,e,r,n){var a;if(n||this.defaultOrganization?t?e?r||(a="Please provide a role"):a="Please provide a scope":a="Please provide a user id":a="Please provide a organization name",a)return Promise.reject(new Error(i.getInvalidParameterMessage("POST",a)));var u=n||this.defaultOrganization,c=s.removeDocType(t);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(u),"/users/").concat(c,"/capabilities"),o.POST,{scope:e,role:r})},a.prototype.updateUserRole=function(t,e,r,n,a){var u;if(a||this.defaultOrganization?t?e?r?n||(u="Please provide a role"):u="Please provide a scope":u="Please provide a capabilityId":u="Please provide a user id":u="Please provide a organization name",u)return Promise.reject(new Error(i.getInvalidParameterMessage("PUT",u)));var c=a||this.defaultOrganization,h=s.removeDocType(t),l=s.removeDocType(e);return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(c),"/users/").concat(h,"/capabilities/").concat(l),o.PUT,{scope:r,role:n})},a.prototype.accessRequestsList=function(t){if(!t&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("GET","Please provide a organization name")));var e=t||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(e),"/access_requests"),o.GET)},a.prototype.sendAccessRequest=function(t,e,r,n){if(!n&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("POST","Please provide a organization name")));var a={email:t,affiliation:e,note:r},u=n||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(u),"/access_requests"),o.POST,a)},a.prototype.deleteAccessRequest=function(t,e){if(!e&&!this.defaultOrganization)return Promise.reject(new Error(i.getInvalidParameterMessage("POST","Please provide a organization name")));var r=e||this.defaultOrganization;return this.dispatch("".concat(this.baseURL,"/organizations/").concat(s.encodeURISegment(r),"/access_requests/").concat(t),o.DELETE)},a.prototype.getUserInfo=function(t){var e=t||"info";return this.dispatch("".concat(this.baseURL,"/users/").concat(s.encodeURISegment(e)),o.GET)},t.exports=a},805(t,e,r){var n=r(6425).default.create({});t.exports=n},9268(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(4557).encodeURISegment;function o(t,e){this.server=void 0,this.baseServer=void 0,this.remote_auth=void 0,this.local_auth=void 0,this.organizationid=!1,this.dbid=!1,this.default_branch_id=e&&e.default_branch_id?e.default_branch_id:"main",this.default_repo_id="local",this.system_db="_system",this.api_extension="api/",this.branchid=this.default_branch_id,this.repoid=this.default_repo_id,this.refid=!1,this.connection_error=!1;var r=this.parseServerURL(t);this.server=r,e&&this.update(e)}r(7135),o.prototype.copy=function(){var t=new o(this.server);return t.api_extension=this.api_extension,t.remote_auth=this.remote_auth,t.local_auth=this.local_auth,t.organizationid=this.organizationid,t.dbid=this.dbid,t.branchid=this.branchid,t.repoid=this.repoid,t.refid=this.refid,t},o.prototype.update=function(t){if(t){var e=t.organization||t.user;this.setOrganization(e),void 0!==t.db&&this.setDB(t.db),void 0!==t.token?this.setLocalBasicAuth(t.token,t.user,"apikey"):void 0!==t.jwt?this.setLocalBasicAuth(t.jwt,t.user,"jwt"):void 0!==t.key?this.setLocalBasicAuth(t.key,t.user):void 0!==t.user&&this.setLocalBasicAuth(null,t.user),void 0!==t.branch&&this.setBranch(t.branch),void 0!==t.ref&&this.setRef(t.ref),void 0!==t.repo&&this.setRepo(t.repo)}},o.prototype.serverURL=function(){return this.server},o.prototype.author=function(){return this.author},o.prototype.apiURL=function(){return this.server+this.api_extension},o.prototype.apiURLInfo=function(){return"".concat(this.apiURL(),"info")},o.prototype.db=function(){if(!this.dbid)throw new Error("Invalid database name");return this.dbid},o.prototype.branch=function(){return this.branchid},o.prototype.ref=function(){return this.refid},o.prototype.organization=function(){return this.organizationid},o.prototype.repo=function(){return this.repoid},o.prototype.localAuth=function(){return!!this.local_auth&&this.local_auth},o.prototype.localUser=function(){return!!this.local_auth&&this.local_auth.user},o.prototype.user=function(t){return!t&&this.remote_auth&&"jwt"===this.remote_auth.type?this.remote_auth.user:!!this.local_auth&&this.local_auth.user},o.prototype.parseServerURL=function(t){if(t&&("http://"===t.substring(0,7)||"https://"===t.substring(0,8)))return t.lastIndexOf("/")!==t.length-1&&(t+="/"),this.serverUrlEncoding(t);throw new Error("Invalid Server URL: ".concat(t))},o.prototype.serverUrlEncoding=function(t){var e=t.split("/");if(e.length>4){this.baseServer=t.replace("".concat(e[3],"/"),"");var r=i(e[3]);return t.replace(e[3],r)}return this.baseServer=t,t},o.prototype.clearCursor=function(){this.branchid=this.default_branch_id,this.repoid=this.default_repo_id,this.organizationid=!1,this.dbid=!1,this.refid=!1},o.prototype.setError=function(t){this.connection_error=t},o.prototype.setOrganization=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"admin";this.organizationid=t},o.prototype.setDB=function(t){this.dbid=t},o.prototype.setRepo=function(t){this.repoid=t},o.prototype.setBranch=function(t){this.branchid=t||this.default_branch_id},o.prototype.setRef=function(t){this.refid=t},o.prototype.setRemoteBasicAuth=function(t,e){this.remote_auth=t?{type:"jwt",user:e,key:t}:void 0},o.prototype.setLocalBasicAuth=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"admin",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"basic";this.local_auth={type:r,user:e,key:t}},o.prototype.setLocalAuth=function(t){this.local_auth=t},o.prototype.setRemoteAuth=function(t){this.remote_auth=t},o.prototype.remoteAuth=function(){return!!this.remote_auth&&this.remote_auth},o.prototype.dbURL=function(){return this.dbBase("db")},o.prototype.userURL=function(t){var e="".concat(this.apiURL(),"user");return t&&(e+="/".concat(i(t))),e},o.prototype.organizationURL=function(t,e){var r="".concat(this.apiURL(),"organization");return t&&(r+="/".concat(i(t))),e&&(r+="/".concat(i(e))),r},o.prototype.userOrganizationsURL=function(){return"".concat(this.apiURL(),"user_organizations")},o.prototype.rolesURL=function(){return"".concat(this.apiURL(),"role")},o.prototype.updateRolesURL=function(){return"".concat(this.apiURL(),"update_role")},o.prototype.graphURL=function(t){return"".concat(this.branchBase("graph"),"/").concat(t,"/main")},o.prototype.triplesURL=function(t){var e="";return this.db()===this.system_db?this.dbBase("triples"):e=this.branchBase("triples"),e+"/".concat(t,"/main")},o.prototype.csvURL=function(){return this.branchBase("csv")},o.prototype.queryURL=function(){return this.db()===this.system_db?this.dbBase("woql"):this.branchBase("woql")},o.prototype.log=function(){return this.db()===this.system_db?this.dbBase("log"):this.branchBase("log")},o.prototype.updateOrganizationRoleURL=function(){return"".concat(this.apiURL(),"update_role")},o.prototype.cloneURL=function(t){var e="".concat(this.apiURL(),"clone/").concat(this.organization());return t&&(e+="/".concat(t)),e},o.prototype.cloneableURL=function(){return"".concat(this.serverURL()).concat(this.organization(),"/").concat(this.db())},o.prototype.pullURL=function(){return this.branchBase("pull")},o.prototype.patchURL=function(){return this.branchBase("patch")},o.prototype.diffURL=function(){return this.branchBase("diff")},o.prototype.applyURL=function(){return this.branchBase("apply")},o.prototype.docHistoryURL=function(t){var e=this.queryParameter(t);return this.db()===this.system_db?this.dbBase("history")+e:this.branchBase("history")+e},o.prototype.fetchURL=function(t){var e=this.dbBase("fetch");return"".concat(e,"/").concat(t,"/_commits")},o.prototype.remoteURL=function(t){var e=this.dbBase("remote");return t?"".concat(e,"/").concat(i(t)):e},o.prototype.rebaseURL=function(){return this.branchBase("rebase")},o.prototype.resetURL=function(){return this.branchBase("reset")},o.prototype.pushURL=function(){return this.branchBase("push")},o.prototype.branchURL=function(t){var e=this.repoBase("branch");return"".concat(e,"/branch/").concat(t)},o.prototype.squashBranchURL=function(t){var e=this.repoBase("squash");return"".concat(e,"/branch/").concat(t)},o.prototype.resetBranchUrl=function(t){var e=this.repoBase("reset");return"".concat(e,"/branch/").concat(t)},o.prototype.commitDescriptorUrl=function(t){return"".concat(this.organization(),"/").concat(this.db(),"/").concat(this.repoid,"/commit/").concat(t)},o.prototype.optimizeBranchUrl=function(t){var e=this.dbBase("optimize");return"".concat(e,"/").concat(this.repoid,"/branch/").concat(encodeURIComponent(t))},o.prototype.dbBase=function(t){return"".concat(this.apiURL()).concat(t,"/").concat(this.dbURLFragment())},o.prototype.repoBase=function(t){var e=this.dbBase(t);return this.repo()?e+="/".concat(this.repo()):e+="/".concat(this.default_repo_id),e},o.prototype.branchBase=function(t){var e=this.repoBase(t);return"_meta"===this.repo()?e:"_commits"===this.branch()?"".concat(e,"/").concat(this.branch()):this.ref()?"".concat(e,"/commit/").concat(this.ref()):this.branch()?"".concat(e,"/branch/").concat(encodeURIComponent(this.branch())):e+="/branch/".concat(this.default_branch_id)},o.prototype.dbURLFragment=function(){return this.db()===this.system_db?this.db():"".concat(i(this.organization()),"/").concat(i(this.db()))},o.prototype.documentURL=function(t){var e=this.queryParameter(t);return this.db()===this.system_db?this.dbBase("document")+e:this.branchBase("document")+e},o.prototype.prefixesURL=function(){return this.db()===this.system_db?this.dbBase("prefixes"):this.branchBase("prefixes")},o.prototype.prefixURL=function(){return this.db()===this.system_db?this.dbBase("prefix"):this.branchBase("prefix")},o.prototype.queryParameter=function(t){if(!t||"object"!==n(t))return"";var e=Object.keys(t).map((function(e){return"".concat(e,"=").concat(i(t[e]))})).join("&");return"?".concat(e)},o.prototype.jsonSchemaURL=function(t){var e=this.queryParameter(t);return this.db()===this.system_db?this.dbBase("schema")+e:this.branchBase("schema")+e},t.exports=o},47(t){t.exports=Object.freeze({POST:"POST",GET:"GET",DELETE:"DELETE",PUT:"PUT",HEAD:"HEAD",QUERY_DOCUMENT:"QUERY_DOCUMENT",SQUASH_BRANCH:"SQUASH_BRANCH",UPDATE_SCHEMA:"UPDATE_SCHEMA",CONNECT:"connect",CREATE_DATABASE:"create_database",READ_DATABASE:"read_database",UPDATE_DATABASE:"update_database",CREATE_USER:"create_user",READ_USER:"read_user",UPDATE_USER:"update_user",CREATE_ORGANIZATION:"create_organization",READ_ORGANIZATION:"read_organization",UPDATE_ORGANIZATION:"update_organization",GET_ROLES:"get_roles",UPDATE_ROLES:"update_roles",CREATE_GRAPH:"create_graph",GET_TRIPLES:"get_triples",INSERT_TRIPLES:"insert_triples",UPDATE_TRIPLES:"update_triples",CLASS_FRAME:"class_frame",WOQL_QUERY:"woql_query",CLONE:"clone",CSV:"csv",WOQL:"woql",FRAME:"frame",PUSH:"push",PULL:"pull",FETCH:"fetch",REBASE:"rebase",RESET:"reset",BRANCH:"branch",REMOTE:"remote",CREATE_REMOTE:"create_remote",GET_REMOTE:"get_remote",UPDATE_REMOTE:"update_remote",DELETE_REMOTE:"delete_remote",RESET_BRANCH:"reset_branch",ADD_CSV:"add_csv",GET_CSV:"get_csv",UPDATE_CSV:"update_csv",MESSAGE:"message",ACTION:"action",INFO:"info",OPTIMIZE_SYSTEM:"optimize_system",GET_DIFF:"getDiff",PATCH:"patch"})},3103(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(1668),o=r(805),s=r(4557),a=r(47),u=r(8139),c=r(8330).version;function h(t){return{result:t.data,dataVersion:t.headers["terminusdb-data-version"]?t.headers["terminusdb-data-version"]:""}}function l(t){if(!t)return"";var e=t.key;return"basic"===t.type&&(e=function(t){try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}}("".concat(t.user,":").concat(t.key))),"".concat({jwt:"Bearer",basic:"Basic",apikey:"Token"}[t.type]," ").concat(e)}r(7135),t.exports=function(t,e,p,f){var d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,y=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,g=arguments.length>6&&void 0!==arguments[6]&&arguments[6],m=arguments.length>7&&void 0!==arguments[7]&&arguments[7],v={mode:"cors",redirect:"follow",referrer:"client",maxContentLength:1/0,maxBodyLength:1/0,headers:{}};if(t.startsWith("https://127.0.0.1")&&"undefined"==typeof window){var b=new(r(2698).Agent)({rejectUnauthorized:!1});v.httpsAgent=b}switch(f&&"object"===n(f)&&(v.headers.Authorization=l(f)),d&&"object"===n(d)&&(v.headers["Authorization-Remote"]=l(d)),y&&"object"===n(y)&&Object.keys(y).map((function(t){v.headers[t]=y[t]})),"undefined"==typeof window&&(v.headers["User-Agent"]="terminusdb-client-js/".concat(c)),e){case a.DELETE:return p&&(v.headers=v.headers?v.headers:{},v.headers["Content-Type"]="application/json; charset=utf-8",v.data=p),o.delete(t,v).then((function(t){return g?h(t):t.data})).catch((function(e){throw u.apiErrorFormatted(t,v,e)}));case a.HEAD:return o.head(t,v).then((function(t){return g?h(t):t.data})).catch((function(e){throw u.apiErrorFormatted(t,v,e)}));case a.GET:if(p){var w=s.URIEncodePayload(p);w&&(t+="?".concat(w))}return o.get(t,v).then((function(t){return g?h(t):t.data})).catch((function(e){throw u.apiErrorFormatted(t,v,e)}));case a.ADD_CSV:case a.INSERT_TRIPLES:return v.headers=v.headers?v.headers:{},v.headers["Content-Type"]="application/form-data; charset=utf-8",o.put(t,p,v).then((function(t){return g?h(t):t.data})).catch((function(e){throw u.apiErrorFormatted(t,v,e)}));case a.PUT:v.headers=v.headers?v.headers:{},v.headers["Content-Type"]="application/json; charset=utf-8";var _=null,O=JSON.stringify(p);return O.length>1024&&m&&(v.headers["Content-Encoding"]="gzip",_=i.gzip(O)),o.put(t,_||p,v).then((function(t){return g?h(t):t.data})).catch((function(e){throw u.apiErrorFormatted(t,v,e)}));case a.QUERY_DOCUMENT:v.headers=v.headers?v.headers:{},v.headers["X-HTTP-Method-Override"]="GET";default:v.headers=v.headers?v.headers:{},v.headers["content-type"]||v.headers["Content-Type"]||(v.headers["Content-Type"]="application/json; charset=utf-8");var E=function(t,e,r){if(!t||"object"!==n(t))return!1;var o=JSON.stringify(t);return!!(o&&o.length>1024&&r)&&(e.headers["Content-Encoding"]="gzip",i.gzip(o))}(p,v,m);return o.post(t,E||p||{},v).then((function(t){return g?h(t):t.data})).catch((function(e){throw u.apiErrorFormatted(t,v,e)}))}}},8139(t){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e,r){var i="";return r.response?(r=r.response).data&&(i+="".concat(n(r.data))):r.body&&(i+="".concat(n(r.body))),t=t.split("?")[0],r.status&&(i+="Code: ".concat(r.status)),r.action&&(i+=" Action: ".concat(r.action)),r.type&&(i+=" Type: ".concat(r.type)),t&&(i+=" url: ".concat(t)),e&&e.method&&(i+=" method: ".concat(e.method)),r.stack&&(i=[i,r.stack].join("\n")),i}function n(t){if("object"===e(t)){for(var r="",n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];t[o]&&"object"!==e(t[o])&&(r+="".concat(o," ").concat(t[o]," "))}return r}return t}function i(t,e,n){return"API Error ".concat(r(t,e,n))}t.exports={apiErrorFormatted:function(t,e,r){var n=new Error(i(t,e,r));return r.response&&r.response.data&&(n.data=r.response.data),r.response&&r.response.status&&(n.status=r.response.status),n},getErrorAsMessage:r,getAPIErrorMessage:i,getAccessDeniedMessage:function(t,e,n){return"Access Denied ".concat(r(t,e,n))},accessDenied:function(t,e,r){var n={status:403};return n.url=(r||"")+(e||""),n.type="client",n.action=t,n.body="".concat(n.action," not permitted for ").concat(n.url),n},getInvalidURIMessage:function(t,e){return"Invalid argument to\n ".concat(e,". \n ").concat(t,"\n is not a valid Terminus DB API endpoint")},getInvalidParameterMessage:function(t,e){return"Invalid Parameter to\n ".concat(t,". \n ").concat(e)},parseAPIError:function(t){var r={};if(r.status=t.status,r.type=t.type,t.data&&"object"===e(t.data)){var n;try{n=t.text()}catch(e){try{n=t.json()}catch(e){n=t.toString()}}r.body=n}else t.data&&(r.body=t.data);return r.url=t.url,r.headers=t.headers,r.redirected=t.redirected,r}}},693(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t){var e=s();return function(){var r,i=a(t);if(e){var o=a(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var u=r(7930),c=(r(7135),function(t){"use strict";!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(n,t);var e,r=o(n);function n(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),r.call(this,t)}return e=n,Object.defineProperty(e,"prototype",{writable:!1}),e}(u));c.prototype.star=function(t,e,r,n){return e=e||"v:Subject",r=r||"v:Predicate",n=n||"v:Object",(t=t||!1)?this.quad(e,r,n,t):this.triple(e,r,n)},c.prototype.all=function(t,e,r,n){return this.star(n,t,e,r)},c.prototype.string=function(t){return{"@type":"xsd:string","@value":String(t)}},c.prototype.boolean=function(t){return t=t||!1,this.literal(t,"boolean")},c.prototype.literal=function(t,e){return{"@type":e=-1===e.indexOf(":")?"xsd:".concat(e):e,"@value":t}},c.prototype.iri=function(t){return{"@type":"NodeValue",node:t}},c.prototype.update_triple=function(t,e,r,n){var i=n||"v:AnyObject__".concat(this.counter+=1);return this.and((new c).opt((new c).triple(t,e,i).delete_triple(t,e,i).not().triple(t,e,r)),(new c).add_triple(t,e,r))},c.prototype.update_quad=function(t,e,r,n){var i="v:AnyObject__".concat(this.counter+=1);return this.and((new c).opt((new c).quad(t,e,i,n).delete_quad(t,e,i,n).not().quad(t,e,r,n)),(new c).add_quad(t,e,r,n))},c.prototype.nuke=function(t){return t?this.quad("v:A","v:B","v:C",t).delete_quad("v:A","v:B","v:C",t):this.triple("v:A","v:B","v:C").delete_triple("v:A","v:B","v:C")},c.prototype.node=function(t,e){"add_quad"===(e=e||!1)?e="AddTriple":"delete_quad"===e?e="DeleteTriple":"add_triple"===e?e="AddTriple":"delete_triple"===e?e="DeleteTriple":("quad"===e||"triple"===e)&&(e="Triple"),e&&e.indexOf(":");var r={subject:t};return e&&(r.action=e),this._set_context(r),this},c.prototype.graph=function(t){return this._set_context({graph:t})},c.prototype._set_context=function(t){for(var e in this.triple_builder_context||(this.triple_builder_context={}),t)this.triple_builder_context[e]=t[e];return this},c.prototype.insert=function(t,e,r){return(r=r||!!this.triple_builder_context&&this.triple_builder_context.graph)?this.add_quad(t,"rdf:type","@schema:".concat(e),r):this.add_triple(t,"rdf:type","@schema:".concat(e))},t.exports=c},8111(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var u=r(4557),c=r(2638),h=r(9156),l=h.Var,p=(h.Vars,h.Doc),f=(r(7135),o((function t(e){"use strict";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,"triple_builder_context",{}),s(this,"query",null),s(this,"counter",1),s(this,"errors",[]),s(this,"cursor",{}),s(this,"chain_ended",!1),s(this,"contains_update",!1),s(this,"paging_transitive_properties",["select","from","start","when","opt","limit"]),s(this,"update_operators",["AddTriple","DeleteTriple","AddQuad","DeleteQuad","InsertDocument","DeleteDocument","UpdateDocument"]),s(this,"vocab",this.loadDefaultVocabulary()),s(this,"tripleBuilder",!1),this.query=e||{},this.cursor=this.query,this})));function d(t){for(var e=y(t),r=[];2===e.length;)r.push(e[0]),e=y(e[1]);return r.push(e[0]),r}function y(t){var e=1;if("("===(t=t.trim()).charAt(0)){for(var r=1;r<t.length;r++)if("("===t.charAt(r)?e++:")"===t.charAt(r)&&e--,0===e){var n=t.substring(r+1).trim();return n?[t.substring(1,r),n]:y(t.substring(1,r))}return[]}if("+"===t[0]||","===t[0]||"|"===t[0]||"*"===t[0]){var i=[t[0]];return t.substring(1)&&i.push(t.substring(1)),i}if("{"===t.charAt(0)){var o=[t.substring(0,t.indexOf("}")+1)];return t.substring(t.indexOf("}")+1)&&o.push(t.substring(t.indexOf("}")+1)),o}for(r=1;r<t.length;r++)if(","===t[r]||"|"===t[r]||"+"===t[r]||"{"===t[r]||"*"===t[r])return[t.substring(0,r),t.substring(r)];return[t]}function g(t,e){if(1===t.length){var r=d(t[0]);return 1===r.length?function(t,e){if(-1!==t.indexOf("<")&&-1!==t.indexOf(">")){var r=t.slice(1,t.length-1),n="."===r?null:e.cleanPathPredicate(r);return{"@type":"PathOr",or:[{"@type":"InversePathPredicate",predicate:n},{"@type":"PathPredicate",predicate:n}]}}if(-1!==t.indexOf("<")){var i=t.slice(1,t.length);return{"@type":"InversePathPredicate",predicate:"."===i?null:e.cleanPathPredicate(i)}}if(-1!==t.indexOf(">")){var o=t.slice(0,t.length-1);return{"@type":"PathPredicate",predicate:"."===o?null:e.cleanPathPredicate(o)}}return{"@type":"PathPredicate",predicate:"."===t?null:e.cleanPathPredicate(t)}}(r[0].trim(),e):g(r,e)}if(-1!==t.indexOf("|")){var n=t.slice(0,t.indexOf("|")),i=t.slice(t.indexOf("|")+1);return{"@type":"PathOr",or:[g(n,e),g(i,e)]}}if(-1!==t.indexOf(",")){var o=t.slice(0,t.indexOf(",")),s=t.slice(t.indexOf(",")+1);return{"@type":"PathSequence",sequence:[g(o,e),g(s,e)]}}if("+"===t[1])return{"@type":"PathPlus",plus:g([t[0]],e)};if("*"===t[1])return{"@type":"PathStar",star:g([t[0]],e)};if("{"===t[1].charAt(0)){var a=t[1].substring(1,t[1].length-1).split(",");return{"@type":"PathTimes",from:a[0],to:a[1],times:g([t[0]],e)}}return e.parameterError("Pattern error - could not be parsed ".concat(t[0])),{"@type":"PathPredicate","rdfs:label":"failed to parse query ".concat(t[0])}}function m(t,e){if(Array.isArray(t))return t;if(e){if("And"===t["@type"]){if(!t.and||!t.and.length)return{};if(1===t.and.length)return m(t.and[0],e)}else if("Or"===t["@type"]){if(!t.or||!t.or.length)return{};if(1===t.or.length)return m(t.or[0],e)}if(void 0!==t.query&&"Comment"!==t["@type"]){if(!t.query["@type"])return{}}else if("Comment"===t["@type"]&&t.comment&&(!t.query||!t.query["@type"]))return{"@type":"Comment",comment:t.comment};if(void 0!==t.consequent&&!t.consequent["@type"])return{}}var r={};for(var i in t){var o=t[i];if(Array.isArray(o)){for(var s=[],a=0;a<o.length;a++)if("object"===n(o[a])){var c=m(o[a],e);c&&u.empty(c)||s.push(c)}else s.push(o[a]);r[i]=s}else if(null===o);else if("object"===n(o)){var h=m(o,e);h&&u.empty(h)||(r[i]=h)}else r[i]=o}return r}f.prototype.parameterError=function(t){return this.errors.push({type:this.cursor["@type"],message:t}),this},f.prototype.hasErrors=function(){return this.errors.length>0},f.prototype.addSubQuery=function(t){if(t)this.cursor.query=this.jobj(t);else{var e={};this.cursor.query=e,this.cursor=e}return this},f.prototype.containsUpdate=function(t){if(t=t||this.query,-1!==this.update_operators.indexOf(t["@type"]))return!0;if(t.consequent&&this.containsUpdate(t.consequent))return!0;if(t.query)return this.containsUpdate(t.query);if(t.and)for(var e=0;e<t.and.length;e++)if(this.containsUpdate(t.and[e]))return!0;if(t.or)for(e=0;e<t.or.length;e++)if(this.containsUpdate(t.or[e]))return!0;return!1},f.prototype.updated=function(){return this.contains_update=!0,this},f.prototype.jlt=function(t,e){return{"@type":e=e?-1===e.indexOf(":")?"xsd:".concat(e):e:"xsd:string","@value":t}},f.prototype.varj=function(t){return t instanceof l&&(t=t.name),"v:"===t.substring(0,2)&&(t=t.substring(2)),"string"==typeof t?{"@type":"Value",variable:t}:t},f.prototype.rawVar=function(t){return t instanceof l?t.name:("v:"===t.substring(0,2)&&(t=t.substring(2)),t)},f.prototype.rawVarList=function(t){for(var e=[],r=0;r<t.length;r++){var n=this.rawVar(t[r]);e.push(n)}return e},f.prototype.jobj=function(t){return t.json?t.json():!0===t?{"@type":"True"}:t},f.prototype.asv=function(t,e,r){var n={};return"number"==typeof t?(n["@type"]="Column",n.indicator={"@type":"Indicator",index:t}):"string"==typeof t&&(n["@type"]="Column",n.indicator={"@type":"Indicator",name:t}),e instanceof l?n.variable=e.name:"v:"===e.substring(0,2)?n.variable=e.substring(2):n.variable=e,r&&(n.type=r),n},f.prototype.wform=function(t){if(t&&t.type&&(this.cursor.format={"@type":"Format",format_type:{"@value":t.type,"@type":"xsd:string"}},void 0!==t.format_header)){var e=!!t.format_header;this.cursor.format.format_header={"@value":e,"@type":"xsd:boolean"}}return this},f.prototype.arop=function(t){return"object"===n(t)?this.jobj(this.cleanArithmeticValue(t)):this.cleanArithmeticValue(t,"xsd:decimal")},f.prototype.dataList=function(t,e){if("string"==typeof t)return this.expandDataVariable(t,!0);if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++){var i=this.cleanDataValue(t[n]);r.push(i)}return r}},f.prototype.valueList=function(t,e){if("string"==typeof t)return this.expandValueVariable(t,!0);if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++){var i=this.cleanObject(t[n]);"string"==typeof i&&(i={node:i}),r.push(i)}return r}},f.prototype.vlist=function(t){for(var e=[],r=0;r<t.length;r++){var n=this.expandValueVariable(t[r]);e.push(n.variable)}return e},f.prototype.dataValueList=function(t){for(var e=[],r=0;r<t.length;r++){var n=this.cleanDataValue(t[r]);e.push(n)}return e},f.prototype.cleanSubject=function(t){var e=!1;return t instanceof l?this.expandNodeVariable(t):"object"===n(t)?t:"string"==typeof t?(t.indexOf("v:"),e=t,this.expandNodeVariable(e)):(this.parameterError("Subject must be a URI string"),"".concat(t))},f.prototype.cleanPredicate=function(t){var e=!1;return t instanceof l?this.expandNodeVariable(t):"object"===n(t)?t:"string"!=typeof t?(this.parameterError("Predicate must be a URI string"),"".concat(t)):(-1!==t.indexOf(":")||this.wellKnownPredicate(t),e=t,this.expandNodeVariable(e))},f.prototype.wellKnownPredicate=function(t,e){if(this.vocab&&this.vocab[t]){var r=this.vocab[t],n=r.substring(0,3);return"system:abstract"!==r&&"xdd"!==n&&"xsd"!==n}return!1},f.prototype.cleanPathPredicate=function(t){return-1!==t.indexOf(":")?t:this.wellKnownPredicate(t)?this.vocab[t]:t},f.prototype.cleanObject=function(t,e){var r={"@type":"Value"};if(t instanceof l)return this.expandValueVariable(t);if(t instanceof p)return t.encoded;if("string"==typeof t){if(-1!==t.indexOf("v:"))return this.expandValueVariable(t);r.node=t}else if("number"==typeof t)e=e||"xsd:decimal",r.data=this.jlt(t,e);else if("boolean"==typeof t)e=e||"xsd:boolean",r.data=this.jlt(t,e);else if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++)i.push(this.cleanObject(t[o]));r.list=i}else if("object"===n(t)&&t){if(void 0===t["@value"])return t;r.data=t}return r},f.prototype.cleanDataValue=function(t,e){var r={"@type":"DataValue"};if(t instanceof l)return this.expandDataVariable(t);if(t instanceof p)return t.encoded;if("string"==typeof t){if(-1!==t.indexOf("v:"))return this.expandDataVariable(t);r.data=this.jlt(t,e)}else if("number"==typeof t)e=e||"xsd:decimal",r.data=this.jlt(t,e);else if("boolean"==typeof t)e=e||"xsd:boolean",r.data=this.jlt(t,e);else if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++)i.push(this.cleanDataValue(t[o]));r.list=i}else if("object"===n(t)&&t){if(!t["@value"])return t;r.data=t}return r},f.prototype.cleanArithmeticValue=function(t,e){var r={"@type":"ArithmeticValue"};if(t instanceof l)return this.expandArithmeticVariable(t);if("string"==typeof t){if(-1!==t.indexOf("v:"))return this.expandArithmeticVariable(t);r.data=this.jlt(t,e)}else if("number"==typeof t)e=e||"xsd:decimal",r.data=this.jlt(t,e);else if("object"===n(t)&&t){if(!t["@value"])return t;r.data=t}return r},f.prototype.cleanNodeValue=function(t,e){var r={"@type":"NodeValue"};if(t instanceof l)return this.expandNodeVariable(t);if("string"==typeof t){if(-1!==t.indexOf("v:"))return this.expandNodeVariable(t);r.node=t}else if("object"===n(t)&&t)return t;return r},f.prototype.cleanGraph=function(t){return t},f.prototype.expandVariable=function(t,e,r){return t instanceof l?{"@type":e,variable:t.name}:"v:"===t.substring(0,2)||r?("v:"===t.substring(0,2)&&(t=t.substring(2)),{"@type":e,variable:t}):{"@type":e,node:t}},f.prototype.expandValueVariable=function(t,e){return this.expandVariable(t,"Value",e)},f.prototype.expandNodeVariable=function(t,e){return this.expandVariable(t,"NodeValue",e)},f.prototype.expandDataVariable=function(t,e){return this.expandVariable(t,"DataValue",e)},f.prototype.expandArithmeticVariable=function(t,e){return this.expandVariable(t,"ArithmeticValue",e)},f.prototype.defaultContext=function(t){var e={};for(var r in u.standard_urls)e[r]=u.standard_urls[r];return e.scm="".concat(t,"/schema#"),e.doc="".concat(t,"/data/"),e},f.prototype.getContext=function(t){t=t||this.query;for(var e=0,r=Object.keys(t);e<r.length;e++){var n=r[e];if("@context"===n)return t[n];if(-1!==this.paging_transitive_properties.indexOf(n)){var i=t[n][1],o=this.getContext(i);if(o)return o}}},f.prototype.context=function(t){this.query["@context"]=t},f.prototype.loadDefaultVocabulary=function(){return{Class:"owl:Class",DatatypeProperty:"owl:DatatypeProperty",ObjectProperty:"owl:ObjectProperty",Document:"system:Document",abstract:"system:abstract",comment:"rdfs:comment",range:"rdfs:range",domain:"rdfs:domain",subClassOf:"rdfs:subClassOf",string:"xsd:string",integer:"xsd:integer",decimal:"xsd:decimal",boolean:"xdd:boolean",email:"xdd:email",json:"xdd:json",dateTime:"xsd:dateTime",date:"xsd:date",coordinate:"xdd:coordinate",line:"xdd:coordinatePolyline",polygon:"xdd:coordinatePolygon"}},f.prototype.setVocabulary=function(t){this.vocab=t},f.prototype.getVocabulary=function(t){return this.vocab},f.prototype.execute=function(t,e){return t.query(this,e)},f.prototype.json=function(t){return t?(this.query=m(t),this):m(this.query,!0)},f.prototype.prettyPrint=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"js";return new c(this.vocab,t).printJSON(this.query)},f.prototype.findLastSubject=function(t){if(t&&t.and)for(var e=t.and.length-1;e>=0;e--){var r=this.findLastSubject(t.and[e]);if(r)return r}if(t&&t.or)for(e=t.or.length-1;e>=0;e--){var n=this.findLastSubject(t.or[e]);if(n)return n}if(t&&t.query){var i=this.findLastSubject(t.query);if(i)return i}return!(!t||!t.subject)&&t},f.prototype.findLastProperty=function(t){if(t&&t.and)for(var e=t.and.length-1;e>=0;e--){var r=this.findLastProperty(t.and[e]);if(r)return r}if(t&&t.or)for(e=t.or.length-1;e>=0;e--){var n=this.findLastProperty(t.or[e]);if(n)return n}if(t&&t.query){var i=this.findLastProperty(t.query);if(i)return i}return!!(t&&t.subject&&this._is_property_triple(t.predicate,t.object))&&t},f.prototype._is_property_triple=function(t,e){var r=t.node?t.node:t,n=e.node?e.node:e;return"owl:ObjectProperty"===n||"owl:DatatypeProperty"===n||"rdfs:domain"===r||"rdfs:range"===r},f.prototype.compilePathPattern=function(t){var e=d(t);if(e&&e.length)return g(e,this);this.parameterError("Pattern error - could not be parsed ".concat(t))},t.exports=f},9156(t){function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){if(null==t)return null;if(function(t){return"object"===r(t)&&null!==t&&!Array.isArray(t)&&"Value"===t["@type"]&&(void 0!==t.dictionary||void 0!==t.list||void 0!==t.data||void 0!==t.node||void 0!==t.variable)}(t))return t;if("number"==typeof t)return{"@type":"Value",data:{"@type":"xsd:decimal","@value":t}};if("boolean"==typeof t)return{"@type":"Value",data:{"@type":"xsd:boolean","@value":t}};if("string"==typeof t)return-1===t.indexOf("v:")?{"@type":"Value",data:{"@type":"xsd:string","@value":t}}:{"@type":"Value",variable:t.split(":")[1]};if(t instanceof i)return{"@type":"Value",variable:t.name};if("object"===r(t)&&!Array.isArray(t)){for(var o=[],s=0,a=Object.entries(t);s<a.length;s++){var u=(l=a[s],p=2,function(t){if(Array.isArray(t))return t}(l)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(l,p)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(l,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=u[0],h=u[1];o.push({"@type":"FieldValuePair",field:c,value:n(h)})}return{"@type":"Value",dictionary:{"@type":"DictionaryTemplate",data:o}}}var l,p;return"object"===r(t)&&Array.isArray(t)?{"@type":"Value",list:t.map(n)}:void 0}function i(t){this.name=t,this.json=function(){return{"@type":"Value",variable:this.name}}}var o=0;function s(t){o+=1;var e="".concat(t,"_").concat(o);this.name=e,this.json=function(){return{"@type":"Value",variable:this.name}}}s.prototype=Object.create(i.prototype),t.exports={Vars:function(){for(var t={},e=0,r=arguments.length;e<r;e+=1){var n=e<0||arguments.length<=e?void 0:arguments[e];t[n]=new i(n)}return t},VarsUnique:function(){for(var t={},e=0,r=arguments.length;e<r;e+=1){var n=e<0||arguments.length<=e?void 0:arguments[e];o+=1,t[n]=new i(n+(o?"_".concat(o):""))}return t},Var:i,VarUnique:s,Doc:function(t){return this.doc=t,this.encoded=n(t),this.encoded},SetVarsUniqueCounter:function(t){o=t}}},601(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function a(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var h=r(693),l=a((function t(){"use strict";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,"default_schema_resource","schema/main"),u(this,"default_commit_resource","_commits"),u(this,"default_meta_resource","_meta"),u(this,"masterdb_resource","_system"),u(this,"empty","")}));l.prototype.branches=function(){return(new h).using("_commits").triple("v:Branch","rdf:type","@schema:Branch").triple("v:Branch","@schema:name","v:Name").opt().triple("v:Branch","@schema:head","v:Head").triple("v:Head","@schema:identifier","v:commit_identifier").triple("v:Head","@schema:timestamp","v:Timestamp")},l.prototype.commits=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=(new h).using("_commits");e&&i.limit(e),r&&i.start(r),i.select("v:Parent ID","v:Commit ID","v:Time","v:Author","v:Branch ID","v:Message");var o=[(new h).triple("v:Branch","name",(new h).string(t)).triple("v:Branch","head","v:Active Commit ID").path("v:Active Commit ID","parent*","v:Parent","v:Path").triple("v:Parent","timestamp","v:Time")];return n&&o.push((new h).less("v:Time",n)),o.push((new h).triple("v:Parent","identifier","v:Commit ID").triple("v:Parent","author","v:Author").triple("v:Parent","message","v:Message").opt().triple("v:Parent","parent","v:Parent ID")),i.and.apply(i,o)},l.prototype.previousCommits=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return(new h).using("_commits").limit(e).select("v:Parent ID","v:Message","v:Commit ID","v:Time","v:Author").and((new h).and((new h).triple("v:Active Commit ID","@schema:identifier",(new h).string(t)),(new h).path("v:Active Commit ID","@schema:parent+","v:Parent","v:Path"),(new h).triple("v:Parent","@schema:identifier","v:Commit ID"),(new h).triple("v:Parent","@schema:timestamp","v:Time"),(new h).triple("v:Parent","@schema:author","v:Author"),(new h).triple("v:Parent","@schema:message","v:Message"),(new h).triple("v:Parent","@schema:parent","v:Parent ID"),(new h).opt().triple("v:Parent","parent","v:Parent ID")))},l.prototype.first_commit=function(){return(new h).using("_commits").select("v:Any Commit IRI").and((new h).triple("v:Branch","name",(new h).string("main")).triple("v:Branch","head","v:Active Commit ID").path("v:Active Commit ID","parent*","v:Any Commit IRI","v:Path"),(new h).triple("v:Any Commit IRI","@schema:identifier","v:Commit ID"),(new h).triple("v:Any Commit IRI","@schema:author","v:Author"),(new h).triple("v:Any Commit IRI","@schema:message","v:Message"),(new h).not().triple("v:Any Commit IRI","@schema:parent","v:Parent IRI"))},l.prototype.rdflist_list=function(t,e){var r=i((new h).localize({consSubject:t,listVar:e,cell:null,value:null}),2),n=r[0],o=r[1];return n((new h).group_by([],[o.value],o.listVar,(new h).and((new h).path(o.consSubject,"rdf:rest*",o.cell),(new h).triple(o.cell,"rdf:first",o.value))))},l.prototype._rdflist_peek_raw=function(t,e){return(new h).and((new h).triple(t,"rdf:type","rdf:List"),(new h).triple(t,"rdf:first",e))},l.prototype.rdflist_peek=function(t,e){var r=i((new h).localize({consSubject:t,valueVar:e}),2),n=r[0],o=r[1];return n(this._rdflist_peek_raw(o.consSubject,o.valueVar))},l.prototype.rdflist_last=function(t,e){var r=i((new h).localize({consSubject:t,valueVar:e,last_cell:null}),2),n=r[0],o=r[1];return n((new h).and((new h).triple(o.consSubject,"rdf:type","rdf:List"),(new h).path(o.consSubject,"rdf:rest*",o.last_cell),(new h).triple(o.last_cell,"rdf:rest","rdf:nil"),(new h).triple(o.last_cell,"rdf:first",o.valueVar)))},l.prototype._rdflist_nth0_raw=function(t,e,r){if(0===e)return this._rdflist_peek_raw(t,r);var n="rdf:rest{".concat(e,",").concat(e,"}");return(new h).and((new h).triple(t,"rdf:type","rdf:List"),(new h).path(t,n,"v:_nth_cell"),(new h).triple("v:_nth_cell","rdf:first",r))},l.prototype.rdflist_nth0=function(t,e,r){if("number"==typeof e){if(e<0)throw new Error("rdflist_nth0 requires index >= 0.");var n=i((new h).localize({consSubject:t,valueVar:r}),2),o=n[0],s=n[1];return o(this._rdflist_nth0_raw(s.consSubject,e,s.valueVar))}var a=i((new h).localize({consSubject:t,index:e,valueVar:r,cell:null,path:null}),2),u=a[0],c=a[1];return u((new h).and((new h).triple(c.consSubject,"rdf:type","rdf:List"),(new h).path(c.consSubject,"rdf:rest*",c.cell,c.path),(new h).length(c.path,c.index),(new h).triple(c.cell,"rdf:first",c.valueVar)))},l.prototype.rdflist_nth1=function(t,e,r){if("number"==typeof e){if(e<1)throw new Error("rdflist_nth1 requires index >= 1.");var n=i((new h).localize({consSubject:t,valueVar:r}),2),o=n[0],s=n[1];return o(this._rdflist_nth0_raw(s.consSubject,e-1,s.valueVar))}throw new Error("rdflist_nth1 with variable index not yet supported with localize pattern")},l.prototype._rdflist_member_raw=function(t,e,r){return(new h).and((new h).path(e,"rdf:rest*",r),(new h).triple(r,"rdf:first",t))},l.prototype.rdflist_member=function(t,e){var r=i((new h).localize({consSubject:t,value:e,member_cell:null}),2),n=r[0],o=r[1];return n((new h).and((new h).triple(o.consSubject,"rdf:type","rdf:List"),this._rdflist_member_raw(o.value,o.consSubject,o.member_cell)))},l.prototype._rdflist_length_raw=function(t,e,r){return(new h).and((new h).triple(t,"rdf:type","rdf:List"),(new h).path(t,"rdf:rest*","rdf:nil",r),(new h).length(r,e))},l.prototype.rdflist_length=function(t,e){var r=i((new h).localize({consSubject:t,lengthVar:e,length_path:null}),2),n=r[0],o=r[1];return n(this._rdflist_length_raw(o.consSubject,o.lengthVar,o.length_path))},l.prototype.rdflist_pop=function(t,e){var r=i((new h).localize({consSubject:t,valueVar:e,second_cons:null,new_first:null,new_rest:null}),2),n=r[0],o=r[1];return n((new h).and((new h).triple(o.consSubject,"rdf:first",o.valueVar),(new h).triple(o.consSubject,"rdf:rest",o.second_cons),(new h).triple(o.second_cons,"rdf:first",o.new_first),(new h).triple(o.second_cons,"rdf:rest",o.new_rest),(new h).delete_triple(o.second_cons,"rdf:type","rdf:List"),(new h).delete_triple(o.second_cons,"rdf:first",o.new_first),(new h).delete_triple(o.second_cons,"rdf:rest",o.new_rest),(new h).delete_triple(o.consSubject,"rdf:first",o.valueVar),(new h).delete_triple(o.consSubject,"rdf:rest",o.second_cons),(new h).add_triple(o.consSubject,"rdf:first",o.new_first),(new h).add_triple(o.consSubject,"rdf:rest",o.new_rest)))},l.prototype.rdflist_push=function(t,e){var r=i((new h).localize({consSubject:t,value:e,old_first:null,old_rest:null,new_cons:null}),2),n=r[0],o=r[1];return n((new h).and((new h).triple(o.consSubject,"rdf:first",o.old_first),(new h).triple(o.consSubject,"rdf:rest",o.old_rest),(new h).idgen_random("terminusdb://data/Cons/",o.new_cons),(new h).add_triple(o.new_cons,"rdf:type","rdf:List"),(new h).add_triple(o.new_cons,"rdf:first",o.old_first),(new h).add_triple(o.new_cons,"rdf:rest",o.old_rest),(new h).delete_triple(o.consSubject,"rdf:first",o.old_first),(new h).delete_triple(o.consSubject,"rdf:rest",o.old_rest),(new h).add_triple(o.consSubject,"rdf:first",o.value),(new h).add_triple(o.consSubject,"rdf:rest",o.new_cons)))},l.prototype.rdflist_append=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"v:_append_new_cell",n=i((new h).localize({consSubject:t,value:e,newCell:r,last_cell:null}),2),o=n[0],s=n[1];return o((new h).and((new h).triple(s.consSubject,"rdf:type","rdf:List"),(new h).path(s.consSubject,"rdf:rest*",s.last_cell),(new h).triple(s.last_cell,"rdf:rest","rdf:nil"),(new h).idgen_random("terminusdb://data/Cons/",s.newCell),(new h).delete_triple(s.last_cell,"rdf:rest","rdf:nil"),(new h).add_triple(s.last_cell,"rdf:rest",s.newCell),(new h).add_triple(s.newCell,"rdf:type","rdf:List"),(new h).add_triple(s.newCell,"rdf:first",s.value),(new h).add_triple(s.newCell,"rdf:rest","rdf:nil")))},l.prototype.rdflist_clear=function(t,e){var r=i((new h).localize({consSubject:t,newListVar:e,cell:null,cell_first:null,cell_rest:null,head_first:null,head_rest:null}),2),n=r[0],o=r[1];return n((new h).and((new h).equals(o.newListVar,"rdf:nil"),(new h).optional((new h).and((new h).path(o.consSubject,"rdf:rest+",o.cell),(new h).triple(o.cell,"rdf:type","rdf:List"),(new h).triple(o.cell,"rdf:first",o.cell_first),(new h).triple(o.cell,"rdf:rest",o.cell_rest),(new h).delete_triple(o.cell,"rdf:type","rdf:List"),(new h).delete_triple(o.cell,"rdf:first",o.cell_first),(new h).delete_triple(o.cell,"rdf:rest",o.cell_rest))),(new h).triple(o.consSubject,"rdf:type","rdf:List"),(new h).triple(o.consSubject,"rdf:first",o.head_first),(new h).triple(o.consSubject,"rdf:rest",o.head_rest),(new h).delete_triple(o.consSubject,"rdf:type","rdf:List"),(new h).delete_triple(o.consSubject,"rdf:first",o.head_first),(new h).delete_triple(o.consSubject,"rdf:rest",o.head_rest)))},l.prototype.rdflist_insert=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"v:_insert_new_node";if(e<0)throw new Error("rdflist_insert requires position >= 0.");if(0===e){var o=i((new h).localize({consSubject:t,value:r,newNodeVar:n,old_first:null,old_rest:null}),2),s=o[0],a=o[1];return s((new h).and((new h).triple(a.consSubject,"rdf:first",a.old_first),(new h).triple(a.consSubject,"rdf:rest",a.old_rest),(new h).idgen("list_node",[a.old_first,a.consSubject],a.newNodeVar),(new h).add_triple(a.newNodeVar,"rdf:type","rdf:List"),(new h).add_triple(a.newNodeVar,"rdf:first",a.old_first),(new h).add_triple(a.newNodeVar,"rdf:rest",a.old_rest),(new h).delete_triple(a.consSubject,"rdf:first",a.old_first),(new h).delete_triple(a.consSubject,"rdf:rest",a.old_rest),(new h).add_triple(a.consSubject,"rdf:first",a.value),(new h).add_triple(a.consSubject,"rdf:rest",a.newNodeVar)))}var u=i((new h).localize({consSubject:t,value:r,newNodeVar:n,pred_node:null,old_rest:null}),2),c=u[0],l=u[1],p=e-1,f=0===p?"":"rdf:rest{".concat(p,",").concat(p,"}"),d=0===p?(new h).eq(l.pred_node,l.consSubject):(new h).path(l.consSubject,f,l.pred_node);return c((new h).and(d,(new h).triple(l.pred_node,"rdf:rest",l.old_rest),(new h).idgen("list_node",[l.value,l.pred_node],l.newNodeVar),(new h).delete_triple(l.pred_node,"rdf:rest",l.old_rest),(new h).add_triple(l.pred_node,"rdf:rest",l.newNodeVar),(new h).add_triple(l.newNodeVar,"rdf:type","rdf:List"),(new h).add_triple(l.newNodeVar,"rdf:first",l.value),(new h).add_triple(l.newNodeVar,"rdf:rest",l.old_rest)))},l.prototype.rdflist_drop=function(t,e){if(e<0)throw new Error("rdflist_drop requires position >= 0.");if(0===e){var r=i((new h).localize({consSubject:t,old_first:null,rest_node:null,next_first:null,next_rest:null}),2),n=r[0],o=r[1];return n((new h).and((new h).triple(o.consSubject,"rdf:first",o.old_first),(new h).triple(o.consSubject,"rdf:rest",o.rest_node),(new h).triple(o.rest_node,"rdf:first",o.next_first),(new h).triple(o.rest_node,"rdf:rest",o.next_rest),(new h).delete_triple(o.rest_node,"rdf:type","rdf:List"),(new h).delete_triple(o.rest_node,"rdf:first",o.next_first),(new h).delete_triple(o.rest_node,"rdf:rest",o.next_rest),(new h).delete_triple(o.consSubject,"rdf:first",o.old_first),(new h).delete_triple(o.consSubject,"rdf:rest",o.rest_node),(new h).add_triple(o.consSubject,"rdf:first",o.next_first),(new h).add_triple(o.consSubject,"rdf:rest",o.next_rest)))}var s=i((new h).localize({consSubject:t,pred_node:null,drop_node:null,drop_first:null,drop_rest:null}),2),a=s[0],u=s[1],c=e-1,l=0===c?"":"rdf:rest{".concat(c,",").concat(c,"}"),p=0===c?(new h).eq(u.pred_node,u.consSubject):(new h).path(u.consSubject,l,u.pred_node);return a((new h).and(p,(new h).triple(u.pred_node,"rdf:rest",u.drop_node),(new h).triple(u.drop_node,"rdf:first",u.drop_first),(new h).triple(u.drop_node,"rdf:rest",u.drop_rest),(new h).delete_triple(u.drop_node,"rdf:type","rdf:List"),(new h).delete_triple(u.drop_node,"rdf:first",u.drop_first),(new h).delete_triple(u.drop_node,"rdf:rest",u.drop_rest),(new h).delete_triple(u.pred_node,"rdf:rest",u.drop_node),(new h).add_triple(u.pred_node,"rdf:rest",u.drop_rest)))},l.prototype.rdflist_swap=function(t,e,r){if(e<0||r<0)throw new Error("rdflist_swap requires positions >= 0.");if(e===r){var n=i((new h).localize({consSubject:t}),2),o=n[0],s=n[1];return o((new h).triple(s.consSubject,"rdf:type","rdf:List"))}var a=i((new h).localize({consSubject:t,node_a:null,node_b:null,value_a:null,value_b:null}),2),u=a[0],c=a[1],l=0===e?(new h).eq(c.node_a,c.consSubject):(new h).path(c.consSubject,"rdf:rest{".concat(e,",").concat(e,"}"),c.node_a),p=0===r?(new h).eq(c.node_b,c.consSubject):(new h).path(c.consSubject,"rdf:rest{".concat(r,",").concat(r,"}"),c.node_b);return u((new h).and(l,p,(new h).triple(c.node_a,"rdf:first",c.value_a),(new h).triple(c.node_b,"rdf:first",c.value_b),(new h).delete_triple(c.node_a,"rdf:first",c.value_a),(new h).delete_triple(c.node_b,"rdf:first",c.value_b),(new h).add_triple(c.node_a,"rdf:first",c.value_b),(new h).add_triple(c.node_b,"rdf:first",c.value_a)))},l.prototype.rdflist_empty=function(t){return(new h).eq(t,"rdf:nil")},l.prototype.rdflist_is_empty=function(t){return(new h).eq(t,"rdf:nil")},l.prototype.rdflist_slice=function(t,e,r,n){if(e<0||r<0)throw new Error("rdflist_slice: negative indices not supported");if(e>=r){var o=i((new h).localize({consSubject:t,resultVar:n}),2),s=o[0],a=o[1];return s((new h).eq(a.resultVar,[]))}var u,c=i((new h).localize({consSubject:t,resultVar:n,node:null,value:null}),2),l=c[0],p=c[1];return u=0===e&&1===r?(new h).eq(p.node,p.consSubject):0===e?(new h).path(p.consSubject,"rdf:rest{0,".concat(r-1,"}"),p.node):(new h).path(p.consSubject,"rdf:rest{".concat(e,",").concat(r-1,"}"),p.node),l((new h).group_by([],[p.value],p.resultVar,(new h).and(u,(new h).triple(p.node,"rdf:first",p.value))))},l.prototype.rdflist_reverse=function(t){var e=i((new h).localize({consSubject:t,node:null,path:null,old_value:null,new_value:null,pos:null,len:null,len_path:null,all_values:null,rev_pos:null,rev_pos_plus1:null}),2),r=e[0],n=e[1],o="v:_slice_result_".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9));return r((new h).and(this._rdflist_length_raw(n.consSubject,n.len,n.len_path),(new h).group_by([],"_rev_collect_value",n.all_values,(new h).and((new h).path(n.consSubject,"rdf:rest*","v:_rev_collect_node"),(new h).triple("v:_rev_collect_node","rdf:first","v:_rev_collect_value"))),(new h).path(n.consSubject,"rdf:rest*",n.node,n.path),(new h).length(n.path,n.pos),(new h).triple(n.node,"rdf:first",n.old_value),(new h).eval((new h).minus((new h).minus(n.len,1),n.pos),n.rev_pos),(new h).eval((new h).plus(n.rev_pos,1),n.rev_pos_plus1),(new h).slice(n.all_values,o,n.rev_pos,n.rev_pos_plus1),(new h).member(n.new_value,o),(new h).delete_triple(n.node,"rdf:first",n.old_value),(new h).add_triple(n.node,"rdf:first",n.new_value)))},t.exports=l},2638(t){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){this.vocab=t,this.language=e,this.indent_spaces=4,this.boxed_predicates=["variable","array_element","node"],this.subject_cleaned_predicates=["subject","element"],this.schema_cleaned_predicates=["predicate","uri","of_type"],this.list_operators=["ValueList","Array","NamedAsVar","IndexedAsVar","AsVar"],this.query_list_operators=["And","Or"],this.operator_maps={IDGenerator:"idgen",IsA:"isa",PostResource:"post",QueryResource:"remote",AsVars:"as",NamedAsVars:"as",IndexedAsVars:"as",DeletedTriple:"removed_triple"},this.shortcuts={optional:"opt",substring:"substr",regexp:"re",subsumption:"sub",equals:"eq",concatenate:"concat"},this.pythonic={and:"woql_and",or:"woql_or",as:"woql_as",with:"woql_with",from:"woql_from",not:"woql_not"},this.show_context=!1}function n(t){return-1===["PathPredicate","PathPlus","PathTimes","InversePathPredicate"].indexOf(t["@type"])}function i(t){for(var e="",r=0;r<t;r++)e+=" ";return e}r.prototype.printJSON=function(t,e,r,n){var o=this;e=e||0,r=r||!1;var s="";if(!t["@type"])return console.log("Bad structure passed to print json, no type: ",t),"";if(["Value","NodeValue","DataValue","ArithmeticValue","OrderTemplate"].indexOf(t["@type"])>-1)return this.pvar(t);var a=t["@type"];if("string"==typeof t["@type"]&&a.indexOf(":")>-1&&(a=t["@type"].split(":")[1]),"QueryResource"===a)return this.getQueryResourceStr(t,e,r,n);if(a){var u=this.unboxJSON(a,t);if(u){var c=this.printArgument(a,this.getBoxedPredicate(a,t),u,e,r);return this.isListOperator(a)?"[".concat(c,"]"):c}if(this.isListOperator(a))s+="[";else{var h=this.getFunctionForOperator(a,t),l=n?e*this.indent_spaces:0;s+="".concat(this.getWOQLPrelude(h,r,l),"(")}var p=this.getArgumentOrder(a,t),f=-1===p.indexOf("query")?p.length-1:p.length-2;p.forEach((function(r,n){var i=!(("query"!==r||"Put"===a)&&"consequent"!==r&&"resource"!==r);"resource"===r&&"string"==typeof t[r]&&(i=!1),s+=o.printArgument(a,r,t[r],e,i),n<f&&"Get"!==a&&(s+=", ")})),this.isListOperator(a)?s+="]":(this.argumentTakesNewline(a)&&(s+="\n".concat(i(e*this.indent_spaces))),r||(s+=")"))}else console.log("wrong structure passed to print json ",t);return s},r.prototype.getQueryResourceStr=function(t,e,r,n){if(!t.source)return console.log("wrong structure passed to print json ",t),"";var i=t.source.url?"remote":"file",o=n?e*this.indent_spaces:0,s="".concat(this.getWOQLPrelude(i,r,o),"("),a=t.source.file?'"'.concat(t.source.file,'"'):'"'.concat(t.source.url,'"'),u="csv"===t.format?"":t.format;return s+=a,u&&(s+=", ".concat(u)),s},r.prototype.getArgumentOrder=function(t,e){var r=Object.keys(e);return r.splice(r.indexOf("@type"),1),r},r.prototype.argumentTakesNewline=function(t){return this.isQueryListOperator(t)},r.prototype.argumentRequiresArray=function(t,e){return("group_by"===t||"list"===t)&&e.length>1},r.prototype.printArgument=function(t,r,n,o,s){var a="";s&&(a+=")");var u=this.argumentTakesNewline(t);if(u&&(a+="\n".concat(i((o+1)*this.indent_spaces))),"True"===n["@type"])return"true";if("document"===r)return this.decompileDocument(n);if("variables"===r)return this.decompileVariables(n);if("group_by"===r||"template"===r)return this.decompileVariables(n,!0);if("columns"===r)return this.decompileAsVars(n,o+1);if("pattern"===r)return this.decompileRegexPattern(n,o+1);if(Array.isArray(n)){for(var c=[],h=0;h<n.length;h++){var l=u?o+1:o;c.push(this.printJSON(n[h],l,s,u))}var p=u?",\n".concat(i(++o*this.indent_spaces)):",";this.argumentRequiresArray(r,c)?a+="[".concat(c.join(p),"]"):a+=c.join(p)}else if("object"===e(n))a+=this.printJSON(n,o,s);else if("string"==typeof n)a+=this.uncleanArgument(n,t,r);else if("number"==typeof n)return n;return a},r.prototype.decompileDocument=function(t){var e={};return this.decompileDictionary(e,t),"WOQL.doc(".concat(JSON.stringify(e),")")},r.prototype.decompileDictionary=function(t,e){var r=this;e.dictionary&&e.dictionary.data&&Array.isArray(e.dictionary.data)&&e.dictionary.data.forEach((function(e){r.decompileFieldValuePair(t,e)}))},r.prototype.decompileFieldValuePair=function(t,e){var r=e.field||"",n=!1;if(e.value&&e.value)if(e.value.data)n=e.value.data["@value"];else if(e.value.dictionary&&Array.isArray(e.value.dictionary.data)){var i={};this.decompileDictionary(i,e.value),n=i}t[r]=n},r.prototype.decompileVariables=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(t)){var r="";return t.forEach((function(e,n){r+='"v:'.concat(e,'"'),n<t.length-1&&(r+=", ")})),e&&t.length>1&&(r="[".concat(r,"]")),r}return""},r.prototype.decompileRegexPattern=function(t){return"object"===e(t)&&"DataValue"===t["@type"]?this.pvar(t):t["@type"].startsWith("Path")?'"'.concat(this.decompilePathPattern(t),'"'):'"'.concat(t.replace("\\","\\\\"),'"')},r.prototype.pvar=function(t){var e=this;if(t.variable){var r=t.variable,n=t.order?t.order:"";return-1===r.indexOf(":")&&(r="v:".concat(r)),""!==n&&"asc"!==n?'["'.concat(r,'","').concat(n,'"]'):'"'.concat(r,'"')}if(t.node)return'"'.concat(t.node,'"');if(t.data)return JSON.stringify(t.data);if(t.list){var i=t.list;if(Array.isArray(i)){var o=[];return i.forEach((function(t,r){o.push(e.pvar(t))})),"[".concat(o.join(", "),"]")}return this.pvar(t.list)}return!1},r.prototype.getWOQLPrelude=function(t,e,r){if("true"===t||"false"===t)return"python"===this.language?t.charAt(0).toUpperCase()+t.slice(1):t;var n="WOQL.";return"python"===this.language&&(this.pythonic[t]&&(t=this.pythonic[t]),n="WOQLQuery()."),e?".".concat(t):(r?"\n".concat(i(r)):"")+n+t},r.prototype.uncleanArgument=function(t,e,r){if(-1!==t.indexOf(":"))for(var n in this.vocab)if(this.vocab[n]===t)return'"'.concat(n,'"');return'"'.concat(t,'"')},r.prototype.isListOperator=function(t){return-1!==this.list_operators.indexOf(t)},r.prototype.isQueryListOperator=function(t){return-1!==this.query_list_operators.indexOf(t)},r.prototype.getFunctionForOperator=function(t,e){if(this.operator_maps[t])return this.operator_maps[t];if("Triple"===t&&e.graph)return"quad";var r=t.replace(/[\w]([A-Z])/g,(function(t){return"".concat(t[0],"_").concat(t[1])})).toLowerCase();return this.shortcuts[r]?this.shortcuts[r]:r},r.prototype.getBoxedPredicate=function(t,e){for(var r=0;r<this.boxed_predicates.length;r++)if(e[this.boxed_predicates[r]])return this.boxed_predicates[r];return"QueryListElement"===t&&"woql:query"},r.prototype.unboxJSON=function(t,e){var r=this.getBoxedPredicate(t,e);return!!r&&e[r]},r.prototype.decompileAsVars=function(t,e){var r=this,n="";return Array.isArray(t)?(t.forEach((function(t,o){if(n+="\n".concat(i(e*r.indent_spaces)).concat(0===o?"WOQL":""),"Column"===t["@type"]&&t.indicator){var s=t.indicator.name||t.indicator.index,a="v:".concat(t.variable),u=t.indicator.type;n+='.as("'.concat(s,'", "').concat(a,'"'),n+=u?', "'.concat(u,'")'):")"}})),n):""},r.prototype.decompilePathPattern=function(t){switch(t["@type"]){case"InversePathPredicate":return t.predicate?"<".concat(t.predicate):"<.";case"PathPredicate":return t.predicate?"".concat(t.predicate):".";case"PathPlus":var e=t.plus;return Array.isArray(e)&&(e=e[0]),n(e)?"(".concat(this.decompilePathPattern(e),")+"):"".concat(this.decompilePathPattern(e),"+");case"PathStar":return e=t.star,Array.isArray(e)&&(e=e[0]),n(e)?"(".concat(this.decompilePathPattern(e),")*"):"".concat(this.decompilePathPattern(e),"*");case"PathTimes":e=t.times;var r=" {".concat(t.from,",").concat(t.to,"}");return Array.isArray(e)&&(e=e[0]),n(e)?"(".concat(this.decompilePathPattern(e),")").concat(r):this.decompilePathPattern(e)+r;case"PathSequence":var i=t.sequence;if(Array.isArray(i)&&2===i.length){var o=i[0],s=i[1];Array.isArray(o)&&(o=o[0]);var a="";return n(o)&&(a+="("),a+=this.decompilePathPattern(o),n(o)&&(a+=")"),a+=",",n(s)&&(a+="("),a+=this.decompilePathPattern(s),"InversePathPredicate"===o["@type"]&&(a+=">"),n(s)&&(a+=")"),a}case"PathOr":var u=t.or;if(Array.isArray(u)&&2===u.length){var c=u[0],h=u[1];return Array.isArray(c)&&(c=c[0]),a="",n(c)&&(a+="("),a+=this.decompilePathPattern(c),n(c)&&(a+=")"),a+="|",n(h)&&(a+="("),a+=this.decompilePathPattern(h),n(h)&&(a+=")"),a}}return"error"},t.exports=r},7930(t,e,r){function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function c(t){var e=h();return function(){var r,n=p(t);if(e){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"==o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},l.apply(null,arguments)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}var f=r(8111),d=r(9156),y=d.Var,g=(d.Vars,d.Doc,d.VarsUnique),m=(r(7135),function(t){"use strict";!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(i,t);var e,r,n=c(i);function i(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),n.call(this,t)}return e=i,(r=[{key:"update_triple",value:function(t,e,r,n){return this}},{key:"star",value:function(t,e,r,n){return this}},{key:"update_quad",value:function(t,e,r,n){return this}},{key:"insert",value:function(t,e,r){return this}},{key:"graph",value:function(t){return this}},{key:"node",value:function(t,e){return this}},{key:"nuke",value:function(t){return this}},{key:"all",value:function(t,e,r,n){return this}},{key:"boolean",value:function(t){return{}}},{key:"string",value:function(t){return{}}},{key:"literal",value:function(t,e){return{}}},{key:"iri",value:function(t){return{}}},{key:"_set_context",value:function(t){return this}},{key:"addSubQuery",value:function(t){return l(p(i.prototype),"addSubQuery",this).call(this,t),this}},{key:"parameterError",value:function(t){return l(p(i.prototype),"parameterError",this).call(this,t),this}},{key:"updated",value:function(){return l(p(i.prototype),"updated",this).call(this),this}}])&&s(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(f));m.prototype.read_document=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="ReadDocument",this.cursor.identifier=this.cleanNodeValue(t),this.cursor.document=this.expandValueVariable(e),this},m.prototype.insert_document=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="InsertDocument",void 0!==e&&(this.cursor.identifier=this.cleanNodeValue(e)),this.cursor.document=this.cleanObject(t),this.updated()},m.prototype.update_document=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="UpdateDocument",void 0!==e&&(this.cursor.identifier=this.cleanNodeValue(e)),this.cursor.document=this.cleanObject(t),this.updated()},m.prototype.delete_document=function(t){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="DeleteDocument",this.cursor.identifier=this.cleanNodeValue(t),this.updated()},m.prototype.wrapCursorWithAnd=function(){if(this.cursor&&"And"===this.cursor["@type"]){var t=this.cursor.and.length;this.and({}),this.cursor=this.cursor.and[t]}else{var e=(new m).json(this.cursor);for(var r in this.cursor)delete this.cursor[r];this.and(e,{}),this.cursor=this.cursor.and[1]}},m.prototype.using=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Using",t&&"string"==typeof t?(this.cursor.collection=t,this.addSubQuery(e)):this.parameterError("The first parameter to using must be a Collection ID (string)")},m.prototype.comment=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Comment",this.cursor.comment=this.jlt(t),this.addSubQuery(e)},m.prototype.select=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Select",!e||e.length<=0)return this.parameterError("Select must be given a list of variable names");var n=e[e.length-1],i=!1;return"object"!==o(n)||n instanceof y||!n.json||(i=e.pop()),this.cursor.variables=this.rawVarList(e),this.addSubQuery(i)},m.prototype.localize=function(t){var e=Object.keys(t),r=g.apply(void 0,e);return[function(i){for(var o=[],s=0,a=e;s<a.length;s++){var u=a[s],c=t[u];null!==c&&("string"==typeof c&&c.startsWith("v:")&&o.push((new m).eq(c,c)),o.push((new m).eq(r[u],c)))}if(i){var h,l=(new m).select("").and(i);return o.length>0?(h=new m).and.apply(h,o.concat([l])):l}var p=new m;return p._localizeOuterEq=o,p.and=function(){var t,e,r=(t=new m).and.apply(t,arguments),i=(new m).select("").and(r);return p._localizeOuterEq.length>0?(e=new m).and.apply(e,n(p._localizeOuterEq).concat([i])):i},p},r]},m.prototype.distinct=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Distinct",!e||e.length<=0)return this.parameterError("Distinct must be given a list of variable names");var n=e[e.length-1],i=!1;return"object"!==o(n)||n instanceof y||!n.json||(i=e.pop()),this.cursor.variables=this.rawVarList(e),this.addSubQuery(i)},m.prototype.and=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(this.cursor["@type"]&&"And"!==this.cursor["@type"]){var n=(new m).json(this.cursor);for(var i in this.cursor)delete this.cursor[i];e.unshift(n)}this.cursor["@type"]="And",void 0===this.cursor.and&&(this.cursor.and=[]);for(var o=0;o<e.length;o++){var s=this.jobj(e[o]);if("And"===s["@type"]&&s.and)for(var a=0;a<s.and.length;a++){var u=s.and[a];if(u){var c=this.jobj(u);this.cursor.and.push(c)}}else this.cursor.and.push(s)}return this},m.prototype.or=function(){this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Or",void 0===this.cursor.or&&(this.cursor.or=[]);for(var t=0;t<arguments.length;t++){var e=this.jobj(t<0||arguments.length<=t?void 0:arguments[t]);this.cursor.or.push(e)}return this},m.prototype.from=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="From",t&&"string"==typeof t?(this.cursor.graph=this.jlt(t),this.addSubQuery(e)):this.parameterError("The first parameter to from must be a Graph Filter Expression (string)")},m.prototype.into=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Into",t&&"string"==typeof t?(this.cursor.graph=this.jlt(t),this.addSubQuery(e)):this.parameterError("The first parameter to from must be a Graph Filter Expression (string)")},m.prototype.triple=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Triple",this.cursor.subject=this.cleanSubject(t),this.cursor.predicate=this.cleanPredicate(e),this.cursor.object=this.cleanObject(r),this},m.prototype.added_triple=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="AddedTriple",this.cursor.subject=this.cleanSubject(t),this.cursor.predicate=this.cleanPredicate(e),this.cursor.object=this.cleanObject(r),this},m.prototype.removed_triple=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="DeletedTriple",this.cursor.subject=this.cleanSubject(t),this.cursor.predicate=this.cleanPredicate(e),this.cursor.object=this.cleanObject(r),this},m.prototype.link=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Triple",this.cursor.subject=this.cleanSubject(t),this.cursor.predicate=this.cleanPredicate(e),this.cursor.object=this.cleanSubject(r),this},m.prototype.value=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Triple",this.cursor.subject=this.cleanSubject(t),this.cursor.predicate=this.cleanPredicate(e),this.cursor.object=this.cleanDataValue(r,"xsd:string"),this},m.prototype.quad=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),n?(this.cursor["@type"]="Triple",this.cursor.graph=this.cleanGraph(n),this):this.parameterError("Quad takes four parameters, the last should be a graph filter")},m.prototype.added_quad=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),n?(this.cursor["@type"]="AddedQuad",this.cursor.graph=this.cleanGraph(n),this):this.parameterError("Quad takes four parameters, the last should be a graph filter")},m.prototype.removed_quad=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),n?(this.cursor["@type"]="DeletedQuad",this.cursor.graph=this.cleanGraph(n),this):this.parameterError("Quad takes four parameters, the last should be a graph filter")},m.prototype.sub=function(t,e){return t&&e?(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Subsumption",this.cursor.parent=this.cleanNodeValue(t),this.cursor.child=this.cleanNodeValue(e),this):this.parameterError("Subsumption takes two parameters, both URIs")},m.prototype.subsumption=m.prototype.sub,m.prototype.eq=function(t,e){return void 0===t||void 0===e?this.parameterError("Equals takes two parameters"):(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Equals",this.cursor.left=this.cleanObject(t),this.cursor.right=this.cleanObject(e),this)},m.prototype.equals=m.prototype.eq,m.prototype.substr=function(t,e,r,n,i){return i||(i=n,n=0),i||(r=(i=r).length+e),t&&i&&"string"==typeof i?(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Substring",this.cursor.string=this.cleanDataValue(t,"xsd:string"),this.cursor.before=this.cleanDataValue(e,"xsd:nonNegativeInteger"),this.cursor.length=this.cleanDataValue(r,"xsd:nonNegativeInteger"),this.cursor.after=this.cleanDataValue(n,"xsd:nonNegativeInteger"),this.cursor.substring=this.cleanDataValue(i,"xsd:string"),this):this.parameterError("Substr - the first and last parameters must be strings representing the full and substring variables / literals")},m.prototype.substring=m.prototype.substr,m.prototype.get=function(t,e){var r;return this.cursor["@type"]="Get",this.cursor.columns=t.json?t.json():(r=new m).as.apply(r,n(t)).json(),this.cursor.resource=e?this.jobj(e):{},this.cursor=this.cursor.resource,this},m.prototype.put=function(t,e,r){var i;if(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Put",Array.isArray(t)&&"object"!==o(t[0]))for(var s=[],a=0;a<t.length;a++){var u=this.asv(a,t[a]);s.push(u),this.cursor.columns=s}else this.cursor.columns=t.json?t.json():(i=new m).as.apply(i,n(t)).json();return this.cursor.query=this.jobj(e),this.cursor.resource=r?this.jobj(r):{},this.cursor=this.cursor.resource,this},m.prototype.as=function(){Array.isArray(this.query)||(this.query=[]);for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(Array.isArray(e[0]))if(e[1])for(a=0;a<e.length;a++){var n=e[a];if(Array.isArray(n)&&n.length>=2){var i=!!(n&&n.length>2)&&n[2],s=this.asv(n[0],n[1],i);this.query.push(s)}}else for(var a=0;a<e[0].length;a++){var u=this.asv(a,e[0][a]);this.query.push(u)}else if("number"==typeof e[0]||"string"==typeof e[0]){if(e[2]&&"string"==typeof e[2])var c=this.asv(e[0],e[1],e[2]);else c=e[1]&&e[1]instanceof y?this.asv(e[0],e[1]):e[1]&&"string"==typeof e[1]?"xsd:"===e[1].substring(0,4)||"xdd:"===e[1].substring(0,4)?this.asv(this.query.length,e[0],e[1]):this.asv(e[0],e[1]):this.asv(this.query.length,e[0]);this.query.push(c)}else"object"===o(e[0])&&this.query.push(e[0].json?e[0].json():e[0]);return this},m.prototype.remote=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="QueryResource",this.cursor.source={"@type":"Source",url:t},this.cursor.format="csv","undefined"!=typeof opts&&(this.cursor.options=e),this},m.prototype.post=function(t,e){var r,n,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"post";return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="QueryResource",this.cursor.source=(r={"@type":"Source"},i=t,(n=a(n=o))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r),this.cursor.format="csv",this.cursor.options=e,void 0!==e&&(this.cursor.options=e),this},m.prototype.delete_triple=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),this.cursor["@type"]="DeleteTriple",this.updated()},m.prototype.add_triple=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),this.cursor["@type"]="AddTriple",this.updated()},m.prototype.delete_quad=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),n?(this.cursor["@type"]="DeleteTriple",this.cursor.graph=this.cleanGraph(n),this.updated()):this.parameterError("Delete Quad takes four parameters, the last should be a graph id")},m.prototype.add_quad=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.triple(t,e,r),n?(this.cursor["@type"]="AddTriple",this.cursor.graph=this.cleanGraph(n),this.updated()):this.parameterError("Add Quad takes four parameters, the last should be a graph id")},m.prototype.trim=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Trim",this.cursor.untrimmed=this.cleanDataValue(t),this.cursor.trimmed=this.cleanDataValue(e),this},m.prototype.eval=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Eval",this.cursor.expression=t.json?t.json():t,this.cursor.result=this.cleanArithmeticValue(e),this},m.prototype.evaluate=function(t,e){return this.eval(t,e)},m.prototype.plus=function(){this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Plus";for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i;return this.cursor.left=this.arop(e.shift()),e.length>1?this.cursor.right=this.jobj((i=new m).plus.apply(i,n(e.map(this.arop)))):this.cursor.right=this.arop(e[0]),this},m.prototype.minus=function(){this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Minus";for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i;return this.cursor.left=this.arop(e.shift()),e.length>1?this.cursor.right=this.jobj((i=new m).minus.apply(i,n(e.map(this.arop)))):this.cursor.right=this.arop(e[0]),this},m.prototype.times=function(){this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Times";for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i;return this.cursor.left=this.arop(e.shift()),e.length>1?this.cursor.right=this.jobj((i=new m).times.apply(i,n(e.map(this.arop)))):this.cursor.right=this.arop(e[0]),this},m.prototype.divide=function(){this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Divide";for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i;return this.cursor.left=this.arop(e.shift()),e.length>1?this.cursor.right=this.jobj((i=new m).divide.apply(i,n(e.map(this.arop)))):this.cursor.right=this.arop(e[0]),this},m.prototype.div=function(){this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Div";for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i;return this.cursor.left=this.arop(e.shift()),e.length>1?this.cursor.right=this.jobj((i=new m).div.apply(i,n(e.map(this.arop)))):this.cursor.right=this.arop(e[0]),this},m.prototype.exp=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Exp",this.cursor.left=this.arop(t),this.cursor.right=this.arop(e),this},m.prototype.floor=function(t){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Floor",this.cursor.argument=this.arop(t),this},m.prototype.isa=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="IsA",this.cursor.element=this.cleanNodeValue(t),this.cursor.type=this.cleanNodeValue(e),this},m.prototype.like=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Like",this.cursor.left=this.cleanDataValue(t,"xsd:string"),this.cursor.right=this.cleanDataValue(e,"xsd:string"),r&&(this.cursor.similarity=this.cleanDataValue(r,"xsd:decimal")),this},m.prototype.less=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Less",this.cursor.left=this.cleanDataValue(t),this.cursor.right=this.cleanDataValue(e),this},m.prototype.greater=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Greater",this.cursor.left=this.cleanDataValue(t),this.cursor.right=this.cleanDataValue(e),this},m.prototype.opt=function(t){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Optional",this.addSubQuery(t),this},m.prototype.optional=m.prototype.opt,m.prototype.unique=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="HashKey",this.cursor.base=this.cleanDataValue(t,"xsd:string"),this.cursor.key_list=this.cleanDataValue(e),this.cursor.uri=this.cleanNodeValue(r),this},m.prototype.idgen=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="LexicalKey",this.cursor.base=this.cleanDataValue(t,"xsd:string"),this.cursor.key_list=this.dataValueList(e),this.cursor.uri=this.cleanNodeValue(r),this},m.prototype.idgenerator=m.prototype.idgen,m.prototype.idgen_random=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="RandomKey",this.cursor.base=this.cleanDataValue(t,"xsd:string"),this.cursor.uri=this.cleanNodeValue(e),this},m.prototype.random_idgen=m.prototype.idgen_random,m.prototype.upper=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Upper",this.cursor.mixed=this.cleanDataValue(t),this.cursor.upper=this.cleanDataValue(e),this},m.prototype.lower=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Lower",this.cursor.mixed=this.cleanDataValue(t),this.cursor.lower=this.cleanDataValue(e),this},m.prototype.pad=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Pad",this.cursor.string=this.cleanDataValue(t),this.cursor.char=this.cleanDataValue(e),this.cursor.times=this.cleanDataValue(r,"xsd:integer"),this.cursor.result=this.cleanDataValue(n),this},m.prototype.split=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Split",this.cursor.string=this.cleanDataValue(t),this.cursor.pattern=this.cleanDataValue(e),this.cursor.list=this.cleanDataValue(r),this},m.prototype.member=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Member",this.cursor.member=this.cleanObject(t),this.cursor.list=this.valueList(e),this},m.prototype.set_difference=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="SetDifference",this.cursor.list_a=this.valueList(t),this.cursor.list_b=this.valueList(e),this.cursor.result=this.valueList(r),this},m.prototype.set_intersection=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="SetIntersection",this.cursor.list_a=this.valueList(t),this.cursor.list_b=this.valueList(e),this.cursor.result=this.valueList(r),this},m.prototype.set_union=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="SetUnion",this.cursor.list_a=this.valueList(t),this.cursor.list_b=this.valueList(e),this.cursor.result=this.valueList(r),this},m.prototype.set_member=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="SetMember",this.cursor.element=this.cleanObject(t),this.cursor.set=this.valueList(e),this},m.prototype.list_to_set=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="ListToSet",this.cursor.list=this.valueList(t),this.cursor.set=this.valueList(e),this},m.prototype.concat=function(t,e){if("string"==typeof t){var r=t.split(/(v:)/),n=[];r[0]&&n.push(r[0]);for(var i=1;i<r.length;i+=2)if(r[i]&&"v:"===r[i]){var o=r[i+1].split(/([^\w_])/),s=o.shift();n.push("v:".concat(s));var a=o.join("");a&&n.push(a)}t=n}return Array.isArray(t)&&(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Concatenate",this.cursor.list=this.cleanDataValue(t,!0),this.cursor.result=this.cleanDataValue(e)),this},m.prototype.concatenate=m.prototype.concat,m.prototype.join=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Join",this.cursor.list=this.cleanDataValue(t),this.cursor.separator=this.cleanDataValue(e),this.cursor.result=this.cleanDataValue(r),this},m.prototype.sum=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Sum",this.cursor.list=this.cleanDataValue(t),this.cursor.result=this.cleanObject(e),this},m.prototype.start=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Start",this.cursor.start=t,this.addSubQuery(e)},m.prototype.limit=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Limit",this.cursor.limit=t,this.addSubQuery(e)},m.prototype.re=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Regexp",this.cursor.pattern=this.cleanDataValue(t),this.cursor.string=this.cleanDataValue(e),this.cursor.result=this.cleanDataValue(r),this},m.prototype.regexp=m.prototype.re,m.prototype.length=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Length",this.cursor.list=this.cleanDataValue(t),null!=e&&(this.cursor.length="number"==typeof e?this.cleanObject(e,"xsd:nonNegativeInteger"):this.varj(e)),this},m.prototype.slice=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Slice",this.cursor.list=this.cleanDataValue(t),this.cursor.result=this.cleanDataValue(e),this.cursor.start="number"==typeof r?this.cleanObject(r,"xsd:integer"):this.cleanDataValue(r),void 0!==n&&(this.cursor.end="number"==typeof n?this.cleanObject(n,"xsd:integer"):this.cleanDataValue(n)),this},m.prototype.not=function(t){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Not",this.addSubQuery(t)},m.prototype.once=function(t){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Once",this.addSubQuery(t)},m.prototype.immediately=function(t){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Immediately",this.addSubQuery(t)},m.prototype.count=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Count",this.cursor.count=this.cleanObject(t),this.addSubQuery(e)},m.prototype.typecast=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Typecast",this.cursor.value=this.cleanObject(t),this.cursor.type=this.cleanNodeValue(e),this.cursor.result=this.cleanObject(r),this},m.prototype.cast=m.prototype.typecast,m.prototype.order_by=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="OrderBy",this.cursor.ordering=[],!e||0===e.length)return this.parameterError("Order by must be passed at least one variables to order the query");for(var n=!("object"!==o(e[e.length-1])||!e[e.length-1].json)&&e.pop(),i=0;i<e.length;i++){var s=void 0;("string"==typeof e[i]||e[i]instanceof y)&&""!==e[i]?s={"@type":"OrderTemplate",variable:this.rawVar(e[i]),order:"asc"}:2===e[i].length&&"asc"===e[i][1]?s={"@type":"OrderTemplate",variable:this.rawVar(e[i][0]),order:"asc"}:2===e[i].length&&"desc"===e[i][1]&&(s={"@type":"OrderTemplate",variable:this.rawVar(e[i][0]),order:"desc"}),s&&this.cursor.ordering.push(s)}return this.addSubQuery(n)},m.prototype.group_by=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="GroupBy",this.cursor.group_by=[],("string"==typeof t||t instanceof y)&&(t=[t]),this.cursor.group_by=this.rawVarList(t),("string"==typeof e||e instanceof y)&&(e=[e]),this.cursor.template=this.rawVarList(e),this.cursor.grouped=this.varj(r),this.addSubQuery(n)},m.prototype.true=function(){return this.cursor["@type"]="True",this},m.prototype.path=function(t,e,r,n){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Path",this.cursor.subject=this.cleanSubject(t),"string"==typeof e&&(e=this.compilePathPattern(e)),this.cursor.pattern=e,this.cursor.object=this.cleanObject(r),void 0!==n&&(this.cursor.path=this.varj(n)),this},m.prototype.dot=function(t,e,r){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Dot",this.cursor.document=this.expandValueVariable(t),this.cursor.field=this.cleanDataValue(e,"xsd:string"),this.cursor.value=this.expandValueVariable(r),this},m.prototype.size=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="Size",this.cursor.resource=this.cleanGraph(t),this.cursor.size=this.varj(e),this},m.prototype.triple_count=function(t,e){return this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="TripleCount",this.cursor.resource=this.cleanGraph(t),this.cursor.count=this.varj(e),this},m.prototype.type_of=function(t,e){return t&&e?(this.cursor["@type"]&&this.wrapCursorWithAnd(),this.cursor["@type"]="TypeOf",this.cursor.value=this.cleanObject(t),this.cursor.type=this.cleanSubject(e),this):this.parameterError("type_of takes two parameters, both values")},t.exports=m},7135(t,e,r){r(4557).ACTIONS.ACTIONS,t.exports={WOQLJson:{},WOQLQuery:{}}},4557(t){function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i={checkValidName:function(t){return"string"==typeof t&&""!==t.trim()&&/^[a-zA-Z0-9_]*$/.test(t)},ACTIONS:{CREATE_DATABASE:"create_database",DELETE_DATABASE:"delete_database",SCHEMA_READ_ACCESS:"schema_read_access",SCHEMA_WRITE_ACCESS:"schema_write_access",INSTANCE_READ_ACCESS:"instance_read_access",INSTANCE_WRITE_ACCESS:"instance_write_access",COMMIT_READ_ACCESS:"commit_read_access",COMMIT_WRITE_ACCESS:"commit_write_access",META_READ_ACCESS:"meta_read_access",META_WRITE_ACCESS:"meta_write_access",CLASS_FRAME:"class_frame",BRANCH:"branch",CLONE:"clone",FETCH:"fetch",PUSH:"push",REBASE:"rebase"},encodeURISegment:function(t){return"string"!=typeof t?t:t=(t=(t=(t=(t=encodeURI(t)).replace(/\?/g,"%3F")).replace(/&/g,"%26")).replace(/\+/g,"%2B")).replace(/#/g,"%23")},decodeURISegment:function(t){return"string"!=typeof t?t:(t=(t=(t=t.replace(/%3F/g,"?")).replace(/%2B/g,"+")).replace(/%23/g,"#"),t=decodeURI(t))},removeDocType:function(t){return"string"==typeof t&&t.lastIndexOf("/")>-1?t.substr(t.lastIndexOf("/")+1):t},standard_urls:{rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",xsd:"http://www.w3.org/2001/XMLSchema#",xdd:"http://terminusdb.com/schema/xdd#",owl:"http://www.w3.org/2002/07/owl#",system:"http://terminusdb.com/schema/system#",vio:"http://terminusdb.com/schema/vio#",repo:"http://terminusdb.com/schema/repository#",layer:"http://terminusdb.com/schema/layer#",woql:"http://terminusdb.com/schema/woql#",ref:"http://terminusdb.com/schema/ref#",api:"http://terminusdb.com/schema/api#"},URIEncodePayload:function(t){if("string"==typeof t)return encodeURIComponent(t);for(var e=[],r=0,i=Object.keys(t);r<i.length;r++){var o=i[r];if("object"===n(t[o]))for(var s=0,a=Object.keys(t[o]);s<a.length;s++){var u=a[s],c=t[o][u];e.push("".concat(encodeURIComponent(u),"=").concat(encodeURIComponent(c)))}else e.push("".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(t[o])))}return e.join("&")},addURLPrefix:function(t,e){this.standard_urls[t]=e},empty:function(t){if(!t)return!0;if(t.length>0)return!1;if(0===t.length)return!0;if("object"===n(t))for(var e=0,r=Object.keys(t);e<r.length;e++){var i=r[e];if(Object.prototype.hasOwnProperty.call(t,i))return!1}return!0},genBNID:function(t){t=t||"";var e=Math.random().toString(36).substring(7),r=new Date;return"".concat(t).concat(e).concat(r.getTime())},getShorthand:function(t){if("object"===n(t)&&t.length&&(t=t[0]),t&&"string"==typeof t)for(var e=0,r=Object.keys(this.standard_urls);e<r.length;e++){var i=r[e],o=this.standard_urls[i];if(t.substring(0,o.length)===o)return"".concat(i,":").concat(t.substring(o.length))}return!1},compareIDs:function(t,e){return t===e||this.unshorten(t)===e||this.shorten(t)===e||this.unshorten(t)===this.unshorten(e)},shorten:function(t,e){if(t)return-1!==t.indexOf("#")?t.split("#").pop():-1!==t.indexOf("terminusdb://")?t.split("/").pop():t},unshorten:function(t){if(t){if(this.validURL(t))return t;if(!t)return t;var e=t.split(":");return e[1]&&this.standard_urls[e[0]]?this.standard_urls[e[0]]+e[1]:t}},json_shorten:function(t,e){var r=this,i=function t(e,i){if(Array.isArray(e)){for(var o=[],s=0;s<e.length;s++)o.push(t(e[s],i));return o}return"object"===n(e)?r.json_shorten(e,i):"string"==typeof e?r.shorten(e,i):e};e=e||t["@context"];var o={};for(var s in t){var a="@"===s[0]?s:this.shorten(s,e),u=i(t[s],e);o[a]=u}return o},json_unshorten:function(t,e){var r=this,i=function t(e,i){if(Array.isArray(e)){for(var o=[],s=0;s<e.length;s++)o.push(t(e[s],i));return o}return"object"===n(e)?r.json_unshorten(e,i):"string"==typeof e?r.unshorten(e,i):e};e=e||t["@context"];var o={};for(var s in t){var a="@"===s[0]?s:this.unshorten(s,e),u=i(t[s],e);o[a]=u}return o},validURL:function(t){return t&&"string"!=typeof t&&(t="".concat(t)),!(!t||"http://"!==t.substring(0,7)&&"https://"!==t.substring(0,8))},isIRI:function(t,e,r){if(!t)return!1;if(r&&e&&e[t.split(":")[0]])return!0;if(e)for(pref in e)if(t.substring(0,e[pref].length)===e[pref])return!0;var n=t.split(":")[0];return-1!==["http","https","terminusdb"].indexOf(n)},labelFromURL:function(t){var e=this.urlFragment(t);return(e=e||t).lastIndexOf("/")<e.length-1&&(e=e.substring(e.lastIndexOf("/")+1)),(e=e.replace(/_/g," ")).charAt(0).toUpperCase()+e.slice(1)},labelFromVariable:function(t){return(t=t.replace(/_/g," ")).charAt(0).toUpperCase()+t.slice(1)},urlFragment:function(t){var r=(t="string"!=typeof t?window.location.href:t).split("#");if(r.length<=1&&(this.validURL(t)||(r=t.split(":"))),r.length>=1){var n=e(r,2)[1];n&&(t=e(n.split("?"),1)[0])}return t},lastURLBit:function(t){var r=e((t=void 0===t?window.location.href:t).split("#"),1);return e(r[0].split("?"),1)[0].substring(t.lastIndexOf("/")+1)},getStdURL:function(t,e,r){if(this.standard_urls[t]){if(!r)return this.standard_urls[t]+e;if(r===this.standard_urls[t]+e)return r}return!1},addNamespacesToVariables:function(t){for(var e=[],r=0;r<t.length;r++)t[r]&&e.push(this.addNamespaceToVariable(t[r]));return e},addNamespaceToVariable:function(t){return"string"==typeof t&&"v:"!==t.substring(0,2)?"v:".concat(t):t},removeNamespaceFromVariable:function(t){return"v:"===t.substring(0,2)?t.substring(2):t},removeNamespacesFromVariables:function(t){for(var e=[],r=0;r<t.length;r++)e.push(this.removeNamespaceFromVariable(t[r]));return e},getConfigValue:function(t,e){if("string"==typeof t&&(t=this.removeNamespaceFromVariable(t)),"string"==typeof t&&e[t]){var r=e[t];return r&&r["@value"]?r["@value"]:r}return t},TypeHelper:{}};i.TypeHelper.isStringType=function(t){return"http://www.w3.org/2001/XMLSchema#string"===t||"xsd:string"===t},i.TypeHelper.isDatatype=function(t){var e=i.shorten(t);return!!(e&&"xsd:"===e.substring(0,4)||"xdd:"===e.substring(0,4))},i.TypeHelper.numberWithCommas=function(t,e){if(e=e||",",t>=1e3||t<=-1e3){var r=t.toString().split(".");t<=-1e3&&(r[0]=r[0].substring(1)),r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,e),t=t<=-1e3?"-".concat(r.join(".")):r.join(".")}return t},i.TypeHelper.formatBytes=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(0===t)return"0 Bytes";var r=e<0?0:e,n=Math.floor(Math.log(t)/Math.log(1024));return"".concat(parseFloat((t/Math.pow(1024,n)).toFixed(r))," ").concat(["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n])},i.TypeHelper.datatypes=["xdd:coordinate","xdd:coordinatePolyline","xdd:coordinatePolygon","xdd:dateRange","xdd:gYearRange","xdd:integerRange","xdd:decimalRange","xdd:cc","xdd:email","xdd:html","xdd:url","xsd:anySimpleType","xsd:string","xsd:boolean","xsd:decimal","xsd:double","xsd:float","xsd:time","xsd:date","xsd:dateTime","xsd:dateTimeStamp","xsd:gYear","xsd:gMonth","xsd:gDay","xsd:gYearMonth","xsd:gMonthDay","xsd:duration","xsd:yearMonthDuration","xsd:dayTimeDuration","xsd:byte","xsd:short","xsd:integer","xsd:long","xsd:unsignedByte","xsd:unsignedInt","xsd:unsignedLong","xsd:nonNegativeInteger","xsd:positiveInteger","xsd:negativeInteger","xsd:nonPositiveInteger","xsd:base64Binary","xsd:anyURI","xsd:language","xsd:normalizedString","xsd:token","xsd:NMTOKEN","xsd:Name","xsd:NCName","xsd:NOTATION","xsd:QName","xsd:ID","xsd:IDREF","xsd:ENTITY","rdf:XMLLiteral","rdf:PlainLiteral","rdfs:Literal","xdd:json"],i.TypeHelper.parseRangeValue=function(t,e){e=e||",";var r=[];return"object"===n(t)&&t.length?r=t:t&&("string"!=typeof t&&(t="".concat(t)),t.length&&"["===t.charAt(0)&&"]"===t.charAt(t.length-1)?(r.push(t.substring(1,t.indexOf(e))),r.push(t.substring(t.indexOf(e)+1,t.length-1))):r.push(t)),r},i.DateHelper={},i.DateHelper.parseXsdTime=function(t){if(!t)return{};var e=this.extractXsdTimezone(t);return e&&(t=t.substring(0,t.length-e.length)),{hour:t.substring(0,2),minute:t.substring(3,5),second:t.substring(6),timezone:e}},i.DateHelper.parseXsdDate=function(t){var e,r,n=this.extractXsdTimezone(t);if(n&&(t=t.substring(0,t.length-n.length)),(e="-"===t.substring(0,1)?t.substring(0,5):t.substring(0,4))&&Math.abs(e)<1e4){var i=t.substring(e.length+1,e.length+3);if(!i)return!1;i=parseInt(i,10);var o=t.substring(e.length+4);if(!o)return!1;r={year:e,month:i,day:o=parseInt(o,10),timezone:n}}return r},i.DateHelper.parseDate=function(t,e){var r;if("xsd:date"===t)r=this.parseXsdDate(e);else if("xsd:time"===t)r=this.parseXsdTime(e);else if("xsd:dateTime"===t)r=this.parseXsdDateTime(e);else if("xsd:gYear"===t)r={year:e};else if("xsd:gYearRange"===t)r={year:e};else if("xsd:gMonth"===t)r={month:e.substring(2)};else if("xsd:gDay"===t)r={day:e};else if("xsd:gYearMonth"===t){for(var n=e.split("-");n.length<2;)n.push("");r={year:n[0],month:n[1]}}else if("xsd:gMonthDay"===t){for(var i=e.split("-");i.length<2;)i.push("");r={month:i[0],day:i[1]}}else"xsd:dateTimeStamp"===t&&(r=this.parseXsdDateTime(e));return r},i.DateHelper.addXsdPadding=function(t){var e={};return void 0!==t.year&&!1!==t.year&&t.year<1e3?Math.abs(t.year)<10?e.year=t.year<0?"-000".concat(Math.abs(t.year)):"000".concat(t.year):Math.abs(t.year)<100?e.year=t.year<0?"-00".concat(Math.abs(t.year)):"00".concat(t.year):e.year=t.year<0?"-0".concat(Math.abs(t.year)):"0".concat(t.year):t.year&&(e.year=t.year),void 0!==t.month&&!1!==t.month&&t.month<10?e.month="0".concat(t.month):t.month&&(e.month=t.month),void 0!==t.day&&!1!==t.day&&t.day<10?e.day="0".concat(t.day):t.day&&(e.day=t.day),void 0!==t.hour&&!1!==t.hour&&t.hour<10?e.hour="0".concat(t.hour):t.hour&&(e.hour=t.hour),void 0!==t.minute&&!1!==t.minute&&t.minute<10?e.minute="0".concat(t.minute):t.minute&&(e.minute=t.minute),void 0!==t.second&&!1!==t.second&&t.second<10?e.second="0".concat(t.second):t.second&&(e.second=t.second),e},i.DateHelper.xsdFromParsed=function(t,e){var r,n=this.addXsdPadding(t);if("xsd:gYear"===e)r=!!n.year&&n.year;else{if("xsd:time"===e)return!!(n.hour&&n.minute&&n.second)&&"".concat(n.hour,":").concat(n.minute,":").concat(n.second);if("xsd:date"===e)return!!(n.year&&n.month&&n.day)&&"".concat(n.year,"-").concat(n.month,"-").concat(n.day);"xsd:dateTime"===e||"xsd:dateTimeStamp"===e?(r=!!(n.year&&n.month&&n.day)&&"".concat(n.year,"-").concat(n.month,"-").concat(n.day,"T"))&&(r+="".concat(n.hour?n.hour:"12",":").concat(n.minute?n.minute:"00",":").concat(n.second?n.second:"00")):"xsd:gMonth"===e?r=!!n.month&&"--".concat(n.month):"xsd:gDay"===e?r=!!n.day&&"---".concat(n.day):"xsd:gYearMonth"===e?r=!(!n.year||!n.month)&&"".concat(n.year,"-").concat(n.month):"xsd:gMonthDay"===e&&(r=!(!n.day||!n.month)&&"--".concat(n.month,"-").concat(n.day))}return n.timezone&&(r+=n.timezone),r},i.DateHelper.convertTimestampToXsd=function(t){var e=new Date(1e3*t);return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()}},i.DateHelper.parseXsdDateTime=function(t){if(!t)return{};if("number"==typeof t)return this.convertTimestampToXsd(t);var e=this.extractXsdTimezone(t);e&&(t=t.substring(0,t.length-e.length));for(var r=this.parseXsdDate(t),n=this.parseXsdTime(t.substring(t.indexOf("T")+1)),i=0,o=Object.keys(n);i<o.length;i++){var s=o[i];r[s]=n[s]}return r.timezone=e,r},i.DateHelper.extractXsdTimezone=function(t){return"string"==typeof t&&t.endsWith("Z")?"Z":("string"!=typeof t||"+"!==t.charAt(t.length-6)&&"-"!==t.charAt(t.length-6)||t.substring(t.length-6),!1)},t.exports=i},9429(t,e,r){var n=r(4876);function i(){n.ViewConfig.call(this),this.type="chart"}function o(){n.WOQLViewRule.call(this)}r(7458),Object.setPrototypeOf(i.prototype,n.ViewConfig.prototype),i.prototype.prettyPrint=function(){for(var t="view = View.chart();\n",e=0;e<this.rules.length;e++)t+="view.".concat(this.rules[e].prettyPrint(),"\n");return void 0!==this.margin()&&(t+="view.margin(".concat(this.margin(),")\n")),void 0!==this.title()&&(t+="view.title('".concat(this.title(),"')\n")),void 0!==this.description()&&(t+="view.description('".concat(this.description(),"')\n")),void 0!==this.layout()&&(t+="view.layout('".concat(this.layout(),"')\n")),void 0!==this.align()&&(t+="view.align('".concat(this.align(),"')\n")),t+this.getBasicPrettyPrint()},i.prototype.json=function(){var t={};return void 0!==this.margin()&&(t.margin=this.margin()),void 0!==this.title()&&(t.title=this.title()),void 0!==this.description()&&(t.description=this.description()),void 0!==this.layout()&&(t.layout=this.layout()),void 0!==this.align()&&(t.align=this.align()),{chart:t,rules:this.getRulesJSON()}},i.prototype.loadJSON=function(t,e){this.loadBasicJSON(t);for(var r=[],n=0;n<e.length;n++){var i=new o;i.json(e[n]),r.push(i)}this.rules=r,void 0!==t.margin&&this.margin(t.margin),void 0!==t.title&&this.title(t.title),void 0!==t.description&&this.description(t.description),void 0!==t.layout&&this.layout(t.layout),void 0!==t.align&&this.align(t.align)},i.prototype.title=function(t){return void 0===t?this._title:(this._title=t,this)},i.prototype.description=function(t){return t?(this._description=t,this):this._description},i.prototype.layout=function(t){return t?(this._layout=t,this):this._layout},i.prototype.align=function(t){return t?(this._align=t,this):this._align},i.prototype.margin=function(t){return t?(this._margin=t,this):this._margin},i.prototype.create=function(t){return new i(t,this)},i.prototype.xAxis=function(){for(var t=(new o).scope("XAxis"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},i.prototype.legend=function(){for(var t=(new o).scope("Legend"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},i.prototype.yAxis=function(){for(var t=(new o).scope("YAxis"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},i.prototype.bar=function(){for(var t=(new o).scope("Bar"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},i.prototype.line=function(){for(var t=(new o).scope("Line"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},i.prototype.point=function(){for(var t=(new o).scope("Point"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},i.prototype.area=function(){for(var t=(new o).scope("Area"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},Object.setPrototypeOf(o.prototype,n.WOQLViewRule.prototype),o.prototype.style=function(t,e){return e?(this.rule[t]=e,this):this.rule[t]},o.prototype.label=function(t){return t?(this.rule.label=t,this):this.rule.label},o.prototype.legendType=function(t){return t?(this.rule.legendType=t,this):this.rule.legendType},o.prototype.fillOpacity=function(t){return t||0===t?(this.rule.fillOpacity=t,this):this.rule.fillOpacity},o.prototype.fill=function(t){return t?(this.rule.fill=t,this):this.rule.fill},o.prototype.stroke=function(t){return t?(this.rule.stroke=t,this):this.rule.stroke},o.prototype.strokeWidth=function(t){return void 0!==t?(this.rule.strokeWidth=t,this):this.rule.strokeWidth},o.prototype.dot=function(t){return void 0!==t?(this.rule.dot=t,this):this.rule.dot},o.prototype.labelRotate=function(t){return void 0!==t?(this.rule.labelRotate=t,this):this.rule.labelRotate},o.prototype.padding=function(t){return t?(this.rule.padding=t,this):this.rule.padding},o.prototype.labelDateInput=function(t){return t?(this.rule.labelDateInput=t,this):this.rule.labelDateInput},o.prototype.labelDateOutput=function(t){return t?(this.rule.labelDateOutput=t,this):this.rule.labelDateOutput},o.prototype.stackId=function(t){return t?(this.rule.stackId=t,this):this.rule.stackId},o.prototype.type=function(t){return t?(this.rule.type=t,this):this.rule.type},o.prototype.axisDomain=function(t){return t?(this.rule.domain=t,this):this.rule.domain},o.prototype.colorEntry=function(t){return t?(this.rule.colorEntry=t,this):this.rule.colorEntry},o.prototype.customColors=function(t){return t?(this.rule.customColors=t,this):this.rule.customColors},o.prototype.payload=function(t){return t?(this.rule.payload=t,this):this.rule.payload},o.prototype.barSize=function(t){return t?(this.rule.barSize=t,this):this.rule.barSize},t.exports=i},1388(t,e,r){var n=r(4876),i=r(5623),o=r(4557);function s(){n.ViewConfig.call(this),this.type="chooser"}function a(t){n.WOQLViewRule.call(this,t)}Object.setPrototypeOf(s.prototype,n.ViewConfig.prototype),s.prototype.create=function(t){return new i(t,this)},s.prototype.prettyPrint=function(){var t="view = View.chooser();\n";t+=this.getBasicPrettyPrint(),void 0!==this.change()&&(t+="view.change(".concat(this.change(),")\n")),void 0!==this.show_empty()&&(t+="view.show_empty('".concat(this.show_empty(),"')\n")),void 0!==this.values()&&(t+="view.values('".concat(o.removeNamespaceFromVariable(this.values()),"')\n")),void 0!==this.labels()&&(t+="view.labels('".concat(o.removeNamespaceFromVariable(this.labels()),"')\n")),void 0!==this.titles()&&(t+="view.titles('".concat(o.removeNamespaceFromVariable(this.titles()),"')\n")),void 0!==this.sort()&&(t+="view.sort(".concat(this.sort(),")\n")),void 0!==this.direction()&&(t+="view.direction('".concat(this.direction(),"')\n"));for(var e=0;e<this.rules.length;e++)t+="view.".concat(this.rules[e].prettyPrint("chooser"),"\n");return t},s.prototype.json=function(){var t=this.getBasicJSON();return void 0!==this.change()&&(t.change=this.change()),void 0!==this.show_empty()&&(t.show_empty=this.show_empty()),void 0!==this.values()&&(t.values=this.values()),void 0!==this.labels()&&(t.labels=this.labels()),void 0!==this.titles()&&(t.titles=this.titles()),void 0!==this.sort()&&(t.sort=this.sort()),void 0!==this.direction()&&(t.direction=this.direction()),{chooser:t,rules:this.getRulesJSON()}},s.prototype.loadJSON=function(t,e){for(var r=[],n=0;n<e.length;n++){var i=new a;i.json(e[n]),r.push(i)}this.rules=r,this.loadBasicJSON(t),void 0!==t.change&&this.change(t.change),void 0!==t.show_empty&&this.show_empty(t.show_empty),void 0!==t.values&&this.values(t.values),void 0!==t.labels&&this.labels(t.labels),void 0!==t.titles&&this.titles(t.titles),void 0!==t.sort&&this.sort(t.sort),void 0!==t.direction&&this.direction(t.direction)},s.prototype.change=function(t){return void 0!==t?(this.onChange=t,this):this.onChange},s.prototype.show_empty=function(t){return void 0!==t?(this.placeholder=t,this):this.placeholder},s.prototype.rule=function(t){var e=(new a).scope("row");return this.rules.push(e),t&&e.vars(t),e},s.prototype.values=function(t){return void 0!==t?("v:"===t.substring(0,2)&&(t=t.substring(2)),this.value_variable=t,this):this.value_variable},s.prototype.labels=function(t){return t?("v:"===t.substring(0,2)&&(t=t.substring(2)),this.label_variable=t,this):this.label_variable},s.prototype.titles=function(t){return t?("v:"===t.substring(0,2)&&(t=t.substring(2)),this.title_variable=t,this):this.title_variable},s.prototype.sort=function(t){return t?("v:"===t.substring(0,2)&&(t=t.substring(2)),this.sort_variable=t,this):this.sort_variable},s.prototype.direction=function(t){return t?(this.sort_direction=t,this):this.sort_direction},Object.setPrototypeOf(a.prototype,n.WOQLViewRule.prototype),a.prototype.label=function(t){return t?(this.rule.label=t,this):this.rule.label},a.prototype.title=function(t){return t?(this.rule.title=t,this):this.rule.title},a.prototype.values=function(t){return t?(this.rule.values=t,this):this.rule.values},a.prototype.selected=function(t){return void 0!==t?(this.rule.selected=t,this):this.rule.selected},a.prototype.prettyPrint=function(){var t=WOQLViewRule.prototype.prettyPrint.apply(this);return void 0!==this.selected()&&(t+=".selected(".concat(this.selected(),")")),void 0!==this.label()&&(t+='.label("'.concat(this.label(),'")')),void 0!==this.title()&&(t+='.title("'.concat(this.title(),'")')),void 0!==this.values()&&(t+='.values("'.concat(this.values(),'")')),t},t.exports=s},7649(t,e,r){var n=r(6487),i=r(8448),o=r(4557);function s(t,e){this.client=t,this.config=e||new i,this.load_schema=!1}function a(t,e){var r=!!e["vio:property"]&&e["vio:property"]["@value"],n=!!e["vio:subject"]&&e["vio:subject"]["@value"],i=(!!e["vio:message"]&&e["vio:message"]["@value"],!!e["api:value"]&&e["api:value"]);i&&'"'===i[0]&&'"'===i[i.length-1]&&(i=i.substring(1,i.length-1));var s=!!e["api:type"]&&e["api:type"];if(s&&i&&t.data().value(i).type(s).errors([e]),r&&n){var a=o.shorten(n);"woql:"===a.substring(0,5)&&a.substring(5),t.data().property(r).value(a,n).errors([e])}}s.prototype.options=function(t){return this.config=t,this},s.prototype.db=function(t){return this.client.db(t),this},s.prototype.loadDocument=function(t,e){var r=this;return e=e||"system:frame",this.client.getDocument(t,{"system:encoding":e}).then((function(t){"system:frame"===e?r.loadDataFrames(t):r.loadJSON(t)}))},s.prototype.loadSchema=function(t,e){var r=this,n=o.unshorten(t);return this.client.getClassFrame(e,n).then((function(t){return r.loadSchemaFrames(t,n)}))},s.prototype.loadComplete=function(t,e){var r=this;return e?Promise.all([this.loadDocument(t),this.loadDocumentSchema(e)]):this.loadDocument(t).then((function(){r.loadSchema(r.document.cls)}))},s.prototype.loadJSON=function(t,e){return this.docid?this.loadDocument(this.docid):this.clsid?this.loadDocumentSchema(this.clsid):void console.error("Either docid or clid must be set before load is called")},s.prototype.loadData=function(t,e,r){e||(this.document?e=this.document.cls:t&&t["@type"]&&(e=t["@type"])),e?this.document?this.document.loadJSONLDDocument(t):this.document=new n(e,t,r):console.log("Missing Class Failed to add dataframes due to missing class")},s.prototype.load=function(t,e){this.document=new n(e["@type"],e,t)},s.prototype.loadSchemaFrames=function(t,e){e||t&&t.length&&t[0]&&t[0].domain&&(e=t[0].domain),e?(this.document||(this.document=new n(e)),t&&(this.document.loadClassFrames(t),this.document.subjid||(this.document.newDoc=!0,this.document.fillFromSchema(o.genBNID("".concat(o.urlFragment(e),"_")))))):console.log("Missing Class","Failed to add class frames due to missing both class and classframes")},s.prototype.filterFrame=function(t){this.applyRules(!1,!1,(function(t,e){void 0!==e.render()&&(t.render=e.render()),e.compare()&&(t.compare=e.compare()),e.errors()?t.errors=t.errors?t.errors.concat(e.errors()):e.errors():!1===e.errors()&&delete t.errors}))},s.prototype.setErrors=function(t,e){this.clearErrors(e);for(var r=0;r<t.length;r++)a(e,t[r]);this.applyRules(!1,e,(function(t,e){e.errors()&&(t.errors=t.errors?t.errors.concat(e.errors()):e.errors())}))},s.prototype.clearErrors=function(t){t.all(),this.applyRules(!1,t,(function(t,e){t.errors&&delete t.errors})),t.rules=[]},s.prototype.applyRules=function(t,e,r){(t=t||this.document)&&(e=e||this.config,t.mfilter(e.rules,(function(t,n){e.setFrameDisplayOptions(t,n),r&&r(t,n)})))},t.exports=s},8448(t,e,r){function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var s=r(4876),a=r(308).FrameRule,u=r(7649);function c(){s.ViewConfig.call(this),this.type="document"}function h(){a.call(this),this.rule={}}Object.setPrototypeOf(c.prototype,s.ViewConfig.prototype),c.prototype.create=function(t){return new u(t,this)},c.prototype.prettyPrint=function(){var t="view = View.document();\n";t+=this.getBasicPrettyPrint(),void 0!==this.load_schema()&&(t+="view.load_schema(".concat(this.load_schema(),")\n"));for(var e=0;e<this.rules.length;e++)t+="view.".concat(this.rules[e].prettyPrint(),"\n");return t},c.prototype.json=function(){var t=this.getBasicJSON();return void 0!==this.load_schema()&&(t.load_schema=this.load_schema()),{frame:t,rules:this.getRulesJSON()}},c.prototype.loadJSON=function(t,e){for(var r=[],n=0;n<e.length;n++){var i=new h;i.json(e[n]),r.push(i)}return this.rules=r,this.loadBasicJSON(t),void 0!==t.load_schema&&this.load_schema(t.load_schema),this},c.prototype.json_rules=function(){for(var t=[],e=0;e<this.rules.length;e++)t.push(this.rules[e].json());return t},c.prototype.load_schema=function(t){return void 0===t?this.get_schema:(this.get_schema=t,this)},c.prototype.show_all=function(t){return this.all().renderer(t),this},c.prototype.show_parts=function(t,e,r){return this.object().renderer(t),this.property().renderer(e),this.data().renderer(r),this},c.prototype.object=function(){var t=(new h).scope("object");return this.rules.push(t),t},c.prototype.property=function(){var t=(new h).scope("property");return this.rules.push(t),t},c.prototype.scope=function(t){var e=(new h).scope(t);return this.rules.push(e),e},c.prototype.data=function(){var t=(new h).scope("data");return this.rules.push(t),t},c.prototype.all=function(){var t=(new h).scope("*");return this.rules.push(t),t},c.prototype.setFrameDisplayOptions=function(t,e){void 0===t.display_options&&(t.display_options={}),void 0!==e.mode()&&(t.display_options.mode=e.mode()),void 0!==e.view()&&(t.display_options.view=e.view()),void 0!==e.showDisabledButtons()&&(t.display_options.show_disabled_buttons=e.showDisabledButtons()),void 0!==e.hidden()&&(t.display_options.hidden=e.hidden()),void 0!==e.collapse()&&(t.display_options.collapse=e.collapse()),void 0!==e.style()&&(t.display_options.style=e.style()),void 0!==e.headerStyle()&&(t.display_options.header_style=e.headerStyle()),void 0!==e.features()&&(t.display_options.features=this.setFrameFeatures(t.display_options.features,e.features())),void 0!==e.headerFeatures()&&(t.display_options.header_features=this.setFrameFeatures(t.display_options.header_features,e.headerFeatures())),void 0!==e.header()&&(t.display_options.header=e.header()),void 0!==e.showEmpty()&&(t.display_options.show_empty=e.showEmpty()),void 0!==e.dataviewer()&&(t.display_options.dataviewer=e.dataviewer()),void 0!==e.args()&&(t.display_options.args=this.setFrameArgs(t.display_options.args,e.args()))},c.prototype.setFrameFeatures=function(t,e){if(!t||!t.length)return e;if(!e||!e.length)return t;for(var r=[],n=0;n<t.length;n++){var i="string"==typeof t[n]?t[n]:Object.keys(t[n])[0];r.push(i)}for(var s=0;s<e.length;s++){var a="string"==typeof e[s]?e[s]:Object.keys(e[s])[0],u=r.indexOf(a);if(-1===u)t.push(e[s]);else if("object"===o(e[s])){var c=t[u];if("string"==typeof c)t[u]=e[s];else if("object"===o(c)){var h=e[s][a];for(var l in h)t[u][a][l]=h[l]}}}return t},c.prototype.setFrameArgs=function(t,e){if(!t)return e;if(!e)return t;for(var r in e)t[r]=e[r];return t},Object.setPrototypeOf(h.prototype,a.prototype),h.prototype.renderer=function(t){return void 0===t?this.rule.renderer:(this.rule.renderer=t,this)},h.prototype.compare=function(t){return void 0===t?this.rule.compare:(this.rule.compare=t,this)},h.prototype.mode=function(t){return void 0===t?this.rule.mode:(this.rule.mode=t,this)},h.prototype.collapse=function(t){return void 0===t?this.rule.collapse:(this.rule.collapse=t,this)},h.prototype.view=function(t){return t?(this.rule.view=t,this):this.rule.view},h.prototype.showDisabledButtons=function(t){return void 0===t?this.rule.show_disabled_buttons:(this.rule.show_disabled_buttons=t,this)},h.prototype.header=function(t){return t?(this.rule.header=t,this):this.rule.header},h.prototype.errors=function(t){return t?(this.rule.errors=t,this):this.rule.errors},h.prototype.headerStyle=function(t){return t?(this.rule.headerStyle=t,this):this.rule.headerStyle},h.prototype.showEmpty=function(t){return t?(this.rule.show_empty=t,this):this.rule.show_empty},h.prototype.dataviewer=function(t){return t?(this.rule.dataviewer=t,this):this.rule.dataviewer},h.prototype.features=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return void 0===e||0===e.length?this.rule.features:(this.rule.features=e,this)},h.prototype.headerFeatures=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return void 0===e||0===e.length?this.rule.header_features:(this.rule.header_features=e,this)},h.prototype.render=function(t){if(!t)return this.rule.render;var e=this.headerFeatures(),r=this.features();if(e&&e.length){var i=this.applyFeatureProperty(e,"render",t);this.headerFeatures.apply(this,n(i))}else r&&r.length?(i=this.applyFeatureProperty(r,"render",t),this.features.apply(this,n(i))):this.rule.render=t;return this},h.prototype.style=function(t){if(void 0===t)return this.rule.style;var e=this.headerFeatures(),r=this.features();if(e&&e.length){var i=this.applyFeatureProperty(e,"style",t);this.headerFeatures.apply(this,n(i))}else r&&r.length?(i=this.applyFeatureProperty(r,"style",t),this.features.apply(this,n(i))):this.rule.style=t;return this},h.prototype.hidden=function(t){if(void 0===t)return this.rule.hidden;var e=this.headerFeatures(),r=this.features();if(e&&e.length){var i=this.applyFeatureProperty(e,"hidden",t);this.headerFeatures.apply(this,n(i))}else r&&r.length?(i=this.applyFeatureProperty(r,"hidden",t),this.features.apply(this,n(i))):this.rule.hidden=t;return this},h.prototype.args=function(t){if(!t)return this.rule.args;var e=this.headerFeatures(),r=this.features();if(e&&e.length){var i=this.applyFeatureProperty(e,"args",t);this.headerFeatures.apply(this,n(i))}else r&&r.length?(i=this.applyFeatureProperty(r,"args",t),this.features.apply(this,n(i))):this.rule.args=t;return this},h.prototype.applyFeatureProperty=function(t,e,r){for(var n=[],i=0;i<t.length;i++)if("string"==typeof t[i])(s={})[t[i]]={},s[t[i]][e]=r,n.push(s);else if("object"===o(t[i])){var s,a=Object.keys(t[i])[0];a&&((s=t[i])[a][e]=r,n.push(s))}return n},h.prototype.unpackFeatures=function(t){for(var e={},r="",n=0;n<t.length;n++){if("string"==typeof t[n])r+='"'.concat(t[n],'"');else if("object"===o(t[n])){var i=Object.keys(t[n])[0];for(var s in r+='"'.concat(i,'"'),t[n][i])e[s]=t[n][i][s]}n<t.length-1&&(r+=", ")}for(var a=0;a<Object.keys(e).length;a++){var u=Object.keys(e)[a],c=e[u];r+=").".concat(u,"("),"function"==typeof c?r+=c:"string"==typeof c?r+='"'.concat(c,'"'):"object"===o(c)&&(r+=JSON.stringify(c))}return r},h.prototype.prettyPrint=function(){return this.pattern&&(str=this.pattern.prettyPrint()),void 0!==this.renderer()&&(str+=".renderer('".concat(this.renderer(),"')")),void 0!==this.render()&&(str+=".render(".concat(this.render,")")),void 0!==this.compare()&&(str+=".compare(".concat(this.compare(),")")),void 0!==this.mode()&&(str+=".mode('".concat(this.mode(),"')")),void 0!==this.collapse()&&(str+=".collapse(".concat(this.collapse(),")")),void 0!==this.hidden()&&(str+=".hidden(".concat(this.hidden(),")")),void 0!==this.view()&&(str+=".view('".concat(this.view(),"')")),void 0!==this.showDisabledButtons()&&(str+=".showDisabledButtons(".concat(this.showDisabledButtons(),")")),void 0!==this.header()&&(str+=".header(".concat(this.header(),")")),void 0!==this.style()&&(str+='.style("'.concat(this.style(),'")')),void 0!==this.headerStyle()&&(str+='.headerStyle("'.concat(this.headerStyle(),'")')),void 0!==this.args()&&(str+=".args(".concat(JSON.stringify(this.args()),")")),void 0!==this.errors()&&(str+=".errors(".concat(JSON.stringify(this.errors()),")")),void 0!==this.showEmpty()&&(str+=".showEmpty(".concat(this.show_empty(),")")),void 0!==this.dataviewer()&&(str+='.dataviewer("'.concat(this.dataviewer(),'")')),void 0!==this.features()&&(str+=".features(".concat(this.unpackFeatures(this.features()),")")),void 0!==this.headerFeatures()&&(str+=".headerFeatures(".concat(this.unpackFeatures(this.headerFeatures()),")")),str},t.exports=c},308(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(1240);function o(){i.TerminusRule.call(this),this.pattern=new s}function s(){i.TerminusPattern.call(this)}Object.setPrototypeOf(o.prototype,i.TerminusRule.prototype),o.prototype.testRules=function(t,e,r){var n=[];if(t&&t.length)for(var i=0;i<t.length;i++)(!t[i].pattern||this.patternMatchesFrame(t[i].pattern,e))&&(n.push(t[i]),r&&"function"==typeof r&&r(e,t[i]));return n},o.prototype.patternMatchesFrame=function(t,e){return t.checkFrame?t.checkFrame(e):(new s).setPattern(t).checkFrame(e)},o.prototype.property=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.property=e,this):this.pattern.property},o.prototype.frame_type=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.frame_type=e,this):this.pattern.frame_type},o.prototype.label=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.label=e,this):this.pattern.label},o.prototype.subject=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.subject=e,this):this.pattern.subject},o.prototype.subjectClass=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.subjectClass=e,this):this.pattern.subjectClass},o.prototype.range=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.range=e,this):this.pattern.range},o.prototype.value=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.value=e,this):this.pattern.value},o.prototype.depth=function(t){return void 0===t?this.pattern.depth:(this.pattern.depth=t,this)},o.prototype.index=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.index=e,this):this.pattern.index},o.prototype.status=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e&&0!==e.length?(this.pattern.status=e,this):this.pattern.status},o.prototype.parent=function(t){return t?(this.pattern.parent=t,this):this.pattern.parent},o.prototype.children=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(void 0===e||0===e.length)return this.pattern.children;void 0===this.pattern.children&&(this.pattern.children=[]);for(var n=0;n<e.length;n++)this.pattern.children.push(e[n]);return this},Object.setPrototypeOf(s.prototype,i.TerminusPattern.prototype),s.prototype.setPattern=function(t){if(t.scope&&(this.scope=t.scope),void 0!==t.literal&&(this.literal=t.literal),void 0!==t.type&&(this.type=t.type),void 0!==t.label&&(this.label=t.label),void 0!==t.frame_type&&(this.frame_type=t.frame_type),void 0!==t.subject&&(this.subject=t.subject),void 0!==t.subjectClass&&(this.subjectClass=t.subjectClass),void 0!==t.range&&(this.range=t.range),void 0!==t.property&&(this.property=t.property),void 0!==t.value&&(this.value=t.value),void 0!==t.parent){var e=t.parent;"function"!=typeof e.json&&(e=(new s).setPattern(e)),this.parent=e}if(t.children){this.children=[];for(var r=0;r<t.children.length;r++){var n=t.children[r];"function"!=typeof n.json&&(n=(new s).setPattern(n)),this.children.push(n)}}void 0!==t.depth&&(this.depth=t.depth),void 0!==t.index&&(this.index=t.index),void 0!==t.status&&(this.status=t.status)},s.prototype.json=function(){var t={};if(void 0!==this.literal&&(t.literal=this.literal),this.type&&(t.type=this.type),this.scope&&(t.scope=this.scope),void 0!==this.value&&(t.value=this.value),void 0!==this.label&&(t.label=this.label),void 0!==this.frame_type&&(t.frame_type=this.frame_type),void 0!==this.subject&&(t.subject=this.subject),void 0!==this.subjectClass&&(t.subjectClass=this.subjectClass),void 0!==this.range&&(t.range=this.range),void 0!==this.property&&(t.property=this.property),void 0!==this.parent&&(t.parent=this.parent.json?this.parent.json():this.parent),void 0!==this.children){t.children=[];for(var e=0;e<this.children.length;e++)t.children.push(this.children[e].json?this.children[e].json():this.children[e])}return void 0!==this.depth&&(t.depth=this.depth),void 0!==this.index&&(t.index=this.index),void 0!==this.status&&(t.status=this.status),t},s.prototype.checkFrame=function(t){var e=this.getRendererType(t);return!(!e||this.scope&&this.scope!==e&&"*"!==this.scope||this.illegalRuleType(e)||this.frame_type&&!this.checkFrameType(e,t)||this.label&&!this.checkLabel(e,t)||this.subject&&!this.checkSubject(e,t)||this.subjectClass&&!this.checkSubjectClass(e,t)||this.property&&!this.checkProperty(e,t)||void 0!==this.depth&&!this.checkDepth(e,t)||this.range&&!this.checkRange(e,t)||void 0!==this.value&&!this.checkValue(e,t)||this.type&&!this.checkType(e,t)||void 0!==this.literal&&!this.checkLiteral(e,t)||this.parent&&!this.checkParent(e,t)||this.children&&this.children.length&&!this.checkChildren(e,t)||this.index&&!this.checkIndex(e,t)||this.status&&!this.checkStatus(e,t))},s.prototype.prettyPrint=function(){if("*"===this.scope)var t="all()";else t="".concat(this.scope,"()");if(void 0!==this.literal&&(t+=".literal(".concat(this.literal,")")),void 0!==this.type&&(t+=".type(".concat(this.unpack(this.type),")")),void 0!==this.range&&(t+=".range(".concat(this.unpack(this.range),")")),void 0!==this.frame_type&&(t+=".frame_type(".concat(this.unpack(this.frameType),")")),void 0!==this.label&&(t+=".label(".concat(this.unpack(this.label),")")),void 0!==this.subject&&(t+=".subject(".concat(this.unpack(this.subject),")")),void 0!==this.subjectClass&&(t+=".subjectClass(".concat(this.unpack(this.subjectClass),")")),void 0!==this.property&&(t+=".property(".concat(this.unpack(this.property),")")),void 0!==this.value&&(t+=".value(".concat(this.unpack(this.value,!0),")")),void 0!==this.children&&this.children.length>0){t+=".children(\n";for(var e=this.children,r=0;r<e.length;r++)t+="View.pattern().".concat(e[r].prettyPrint()),r<e.length-1&&(t+=","),t+="\n";t+=")"}return void 0!==this.parent&&(t+=".parent(View.pattern().".concat(this.parent.prettyPrint(),")")),void 0!==this.depth&&(t+=".depth(".concat(this.unpack(this.depth,!0),")")),void 0!==this.index&&(t+=".index(".concat(this.unpack(this.index,!0),")")),void 0!==this.status&&(t+=".status(".concat(this.unpack(this.status),")")),t},s.prototype.illegalRuleType=function(t){return!("data"!==t||!this.children||!this.children.length)||!("object"!==t||!this.range)},s.prototype.checkSubject=function(t,e){"object"===n(this.subject)&&this.subject.length||(this.subject=[this.subject]);for(var r=e.subject(),i=0;i<this.subject.length;i++)if(this.IDsMatch(t[i],r))return!0;return!1},s.prototype.checkChildren=function(t,e){for(var r=0;r<this.children.length;r++){var n=!1;if("object"===t)for(var i in e.properties)this.children[r].checkFrame(e.properties[i])&&(n=!0);else if("property"===t)for(var o=0;o<=renderer.values.length;o++)this.children[o].checkFrame(e.values[o])&&(n=!0);if(!n)return!1}return!0},s.prototype.checkStatus=function(t,e){"object"===n(this.status)&&0!==this.status.length||(this.status=[this.status]);for(var r=0;r<this.status.length;r++){if("updated"===this.status[r]&&!e.isUpdated())return!1;if("new"===this.status[r]&&!e.isNew())return!1;if("unchanged"===this.status[r]&&e.isUpdated())return!1}return!0},s.prototype.checkDepth=function(t,e){return this.numberMatch(this.depth,e.depth())},s.prototype.checkParent=function(t,e){return this.parent.checkFrame(e.parent)},s.prototype.checkIndex=function(t,e){return"data"===t&&this.index===e.index},s.prototype.checkProperty=function(t,e){"object"===n(this.property)&&this.property.length||(this.property=[this.property]);for(var r=0;r<this.property.length;r++)if(this.propertyIDsMatch(e.property(),this.property[r]))return!0;return!1},s.prototype.checkType=function(t,e){if("object"===t)var r=e.subjectClass();else r="function"==typeof e.range?e.range():e.range;return Array.isArray(this.type)||(this.type=[this.type]),-1!==this.type.indexOf(r)},s.prototype.checkLiteral=function(t,e){return"object"!==t&&"property"!==t&&("data"!==t||e.isDatatypeProperty())},s.prototype.checkValue=function(t,e){"object"===n(this.value)&&this.value.length||(this.value=[this.value]);for(var r=0;r<this.value.length;r++)if("data"===t){if(this.valuesMatch(e.get(),this.value[r]))return!0}else if("property"===t){for(var i=0;i<=e.values.length;i++)if("data"===this.getRendererType(e.values[r])&&this.valuesMatch(e.values[r].get(),this.value[r]))return!0}else if("object"===t)for(var o in e.properties)if(this.checkValue(this.getRendererType(e.properties[o]),e.properties[o]))return!0;return!1},s.prototype.checkRange=function(t,e){"object"===n(this.range)&&this.range.length||(this.range=[this.range]);for(var r=0;r<this.range.length;r++)if(this.rangeIDsMatch(e.range(),this.range[r]))return!0;return!1},s.prototype.checkSubjectClass=function(t,e){"object"===n(this.subjectClass)&&this.subjectClass.length||(this.subjectClass=[this.subjectClass]);for(var r=e.subjectClass(),i=0;i<this.subjectClass.length;i++)if(this.classIDsMatch(this.subjectClass[i],r))return!0;return!1},s.prototype.checkFrameType=function(t,e){return"object"===t?-1!==this.frame_type.indexOf("object"):"data"===t&&e.frame?-1!==this.frame_type.indexOf(e.frame.ftype()):"property"!==t&&void 0},s.prototype.checkLabel=function(t,e){if("function"!=typeof e.getLabel)return console.log(new Error("Rule passed to check label with broken renderer object - no getLabel")),!1;for(var r=0;r<this.label.length;r++)if(this.stringMatch(this.label[r],e.getLabel()))return!0;return!1},s.prototype.getRendererType=function(t){return t.isProperty()?"property":t.isObject()?"object":t.isData()?"data":t.renderer_type?t.renderer_type:(console.log(t,new Error("frame configuration passed non-renderer type ".concat(t.constructor.name))),!1)},t.exports={FrameRule:o,FramePattern:s}},3065(t,e,r){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(4876),o=r(686),s=r(4557);function a(){i.ViewConfig.call(this),this.type="graph"}function u(t){i.WOQLViewRule.call(this,t)}Object.setPrototypeOf(a.prototype,i.ViewConfig.prototype),a.prototype.create=function(t){return new o(t,this)},a.prototype.literals=function(t){return void 0!==t?(this.show_literals=t,this):this.show_literals},a.prototype.source=function(t){return t?(this.source_variable=s.removeNamespaceFromVariable(t),this):this.source_variable},a.prototype.fontfamily=function(t){return void 0!==t?(this.fontfam=t,this):this.fontfam},a.prototype.show_force=function(t){return void 0!==t?(this.force=t,this):this.force},a.prototype.fix_nodes=function(t){return void 0!==t?(this.fixed=t,this):this.fixed},a.prototype.explode_out=function(t){return void 0!==t?(this.explode=t,this):this.explode},a.prototype.selected_grows=function(t){return void 0!==t?(this.bigsel=t,this):this.bigsel},a.prototype.width=function(t){return void 0!==t?(this.gwidth=t,this):this.gwidth},a.prototype.height=function(t){return void 0!==t?(this.gheight=t,this):this.gheight},a.prototype.edges=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(e&&e.length){for(var n=[],i=0;i<e.length;i++)n.push(s.removeNamespacesFromVariables(e[i]));return this.show_edges=n,this}return this.show_edges},a.prototype.edge=function(t,e){var r=(new u).edge(t,e);return this.rules.push(r),r},a.prototype.node=function(){for(var t=new u,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r&&r.length?t.scope("node").setVariables(r):t.scope("row"),this.rules.push(t),t},a.prototype.loadJSON=function(t,e){for(var r=[],i=0;i<e.length;i++){var o=new u;o.json(e[i]),r.push(o)}var s;this.rules=r,void 0!==t.literals&&this.literals(t.literals),void 0!==t.source&&this.source(t.source),void 0!==t.fontfamily&&this.fontfamily(t.fontfamily),void 0!==t.show_force&&this.show_force(t.show_force),void 0!==t.fix_nodes&&this.fix_nodes(t.fix_nodes),void 0!==t.explode_out&&this.explode_out(t.explode_out),void 0!==t.selected_grows&&this.selected_grows(t.selected_grows),void 0!==t.width&&this.width(t.width),void 0!==t.height&&this.height(t.height),void 0!==t.edges&&this.edges.apply(this,function(t){if(Array.isArray(t))return n(t)}(s=t.edges)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(s)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},a.prototype.prettyPrint=function(){var t="view = View.graph();\n";if(void 0!==this.literals()&&(t+="view.literals('".concat(this.literals(),"')\n")),void 0!==this.source()&&(t+="view.source('".concat(s.removeNamespaceFromVariable(this.source()),"')\n")),void 0!==this.fontfamily()&&(t+="view.fontfamily('".concat(this.fontfamily(),"')\n")),void 0!==this.show_force()&&(t+="view.show_force('".concat(this.show_force(),"')\n")),void 0!==this.fix_nodes()&&(t+="view.fix_nodes('".concat(this.fix_nodes(),"')\n")),void 0!==this.explode_out()&&(t+="view.explode_out('".concat(this.explode_out(),"')\n")),void 0!==this.selected_grows()&&(t+="view.selected_grows('".concat(this.selected_grows(),"')\n")),void 0!==this.width()&&(t+="view.width('".concat(this.width(),"')\n")),void 0!==this.height()&&(t+="view.height('".concat(this.height(),"')\n")),void 0!==this.edges()){for(var e=this.edges(),r=[],n=0;n<e.length;n++)r.push("['".concat(e[n][0],", ").concat(e[n][1],"']"));t+="view.edges('".concat(r.join(", "),"')\n")}for(n=0;n<this.rules.length;n++){var i=this.rules[n].prettyPrint();i&&(t+="view.".concat(i,"\n"))}return t},a.prototype.json=function(){for(var t=[],e=0;e<this.rules.length;e++)t.push(this.rules[e].json());var r={};return void 0!==this.literals()&&(r.literals=this.literals()),void 0!==this.source()&&(r.source=this.source()),void 0!==this.fontfamily()&&(r.fontfamily=this.fontfamily()),void 0!==this.show_force()&&(r.show_force=this.show_force()),void 0!==this.fix_nodes()&&(r.fix_nodes=this.fix_nodes()),void 0!==this.explode_out()&&(r.explode_out=this.explode_out()),void 0!==this.selected_grows()&&(r.selected_grows=this.selected_grows()),void 0!==this.width()&&(r.width=this.width()),void 0!==this.height()&&(r.height=this.height()),void 0!==this.edges()&&(r.edges=this.edges()),{graph:r,rules:t}},Object.setPrototypeOf(u.prototype,i.WOQLViewRule.prototype),u.prototype.charge=function(t){return void 0===t?this.rule.charge:(this.rule.charge=t,this)},u.prototype.collisionRadius=function(t){return void 0===t?this.rule.collisionRadius:(this.rule.collisionRadius=t,this)},u.prototype.arrow=function(t){return t?(this.rule.arrow=t,this):this.rule.arrow},u.prototype.distance=function(t){return void 0!==t?(this.rule.distance=t,this):this.rule.distance},u.prototype.symmetric=function(t){return void 0!==t?(this.rule.symmetric=t,this):this.rule.symmetric},u.prototype.weight=function(t){return void 0!==t?(this.rule.weight=t,this):this.rule.weight},u.prototype.prettyPrint=function(){var t=i.WOQLViewRule.prototype.prettyPrint.apply(this);return void 0!==this.charge()&&(t+=".charge('".concat(this.charge(),"')")),void 0!==this.distance()&&(t+=".distance('".concat(this.distance(),"')")),void 0!==this.weight()&&(t+=".weight('".concat(this.weight(),"')")),void 0!==this.symmetric()&&(t+=".symmetric(".concat(this.symmetric(),")")),void 0!==this.collisionRadius()&&(t+=".collisionRadius(".concat(this.collisionRadius(),")")),void 0!==this.arrow()&&(t+=".arrow(".concat(JSON.stringify(this.arrow()),")")),t},t.exports=a},6487(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(4557),o=r(308).FrameRule,s=r(7589);function a(t,e,r,o){this.empty(),this.cls=i.unshorten(t),r&&"object"===n(r)&&this.loadClassFrames(r),e&&"object"===n(e)&&Object.keys(e).length?(this.originalDocument=e,this.loadJSONLDDocument(e)):this.originalDocument=!1,this.parent=o,this.newDoc=!1}function u(t,e,r){this.predicate=t,this.cframe=e,this.parent=r,this.values=[]}function c(t,e,r){return this.err=!1,this.index=r,e&&this.loadParent(e),t&&(this.rangeValue=t,t["@type"]&&(this.range=t["@type"]),t["@language"]&&(this.language=t["@language"]),this.type||(this.type=t["@value"]?"datatypeProperty":"objectProperty")),this}function h(t,e,r){if(this.err=!1,this.parent=e,this.subjid=!!e&&e.subjid,t){if(t.label){var n=r||"";t.label["@value"]?this.label=t.label["@value"]:t.label?this.label=t.label:this.label=n}this.load(t)}}function l(t){this.min=0,this.max=0,t&&this.loadRestriction(t)}a.prototype.loadClassFrames=function(t){for(var e=0;e<t.length;e+=1){t[e]["@context"]&&(this.jsonld_context=t[e]["@context"]);var r=new h(t[e],this);if(r.isValid()){if(this.classframes||(this.classframes={}),this.classframes[t[e].property]=r,r.isObject()&&this.properties[t[e].property])for(var n=0;n<this.properties[t[e].property].values.length;n+=1)this.properties[t[e].property].values[n].loadClassFrames(t[e].frame)}else console.log("Invalid classframe",r)}return this},a.prototype.hasSchema=function(){return!i.empty(this.classframes)},a.prototype.loadJSONLDDocument=function(t){if("object"===n(t)){var e=i.json_unshorten(t);for(var r in this.originalDocument||(this.originalDocument=e),!this.subjid&&e["@id"]&&(this.subjid=i.unshorten(e["@id"])),e["@context"]&&(this.jsonld_context=e["@context"]),e)if("@"!==r[0]&&("object"!==n(e[r])||0!==Object.keys(e[r]).length)){var o=this.getPropertyClassFrame(r,e);o&&o.isClassChoice()?o||console.log("no choice frame ".concat(e[r]["@type"])):o&&o.isLogic()&&(o=o.getChosenFrame(e[r])),o&&(void 0===this.properties[r]&&(this.properties[r]=new u(r,o,this)),this.properties[r].addJSONLDDocument(e[r]))}return this}},a.prototype.getAsFrame=function(t,e){if(t=i.unshorten(t),this.parentframe)return this.parentframe;var r={type:"objectProperty",property:t};r.range=this.cls,r.domain=e.cls,r.domainValue=e.subjid,r.frame=[];for(var n=0,o=Object.keys(this.properties);n<o.length;n++){var s=o[n];r.frame=r.frame.concat(r.frame,this.properties[s].getAsFrames())}return r},a.prototype.getAsFrames=function(t,e){for(var r=[],n=0,i=Object.keys(this.properties);n<i.length;n++){var o=i[n];r=r.concat(r,this.properties[o].getAsFrames())}return r},a.prototype.empty=function(){this.properties={},this.restrictions={},this.subjid=!1,this.cls=!1},a.prototype.reset=function(t){if(t){t=i.unshorten(t);for(var e=[],r=0;r<this.originalFrames.length;r+=1)this.originalFrames[r].property===t&&e.push(this.originalFrames[r]);this.properties[t]&&(this.properties[t]=[]),this.loadDataFrames(e)}else this.restrictions={},this.properties={},this.loadDataFrames(this.originalFrames)},a.prototype.clear=function(){for(var t=0,e=Object.keys(this.properties);t<e.length;t++){var r=e[t];this.properties[r].clear()}return this},a.prototype.mfilter=function(t,e){(new o).testRules(t,this,e);for(var r=0,n=Object.keys(this.properties);r<n.length;r++){var i=n[r];this.properties[i].mfilter?this.properties[i].mfilter(t,e):console.log(i,this.properties[i])}return this},a.prototype.getPropertyClassFrame=function(t,e){if("object"===n(t))return new h(t);if(t=i.unshorten(t),this.classframes&&"object"===n(this.classframes)&&"object"===n(this.classframes[t]))return this.classframes[t];if(e){var r=new h;return r.loadFromJSONLD(e,t),r}return!!this.properties[t]&&new h(this.properties[t].values[0])},a.prototype.getProperties=function(t){if("filled"===t||!this.classframes)return Object.keys(this.properties);if("missing"===t){for(var e=Object.keys(this.properties).map((function(t){return i.unshorten(t)})),r=Object.keys(this.classframes).map((function(t){return i.unshorten(t)})),n=[],o=0;o<r.length;o++)-1===e.indexOf(r[o])&&-1===n.indexOf(r[o])&&n.push(r[o]);return n}return Object.keys(this.classframes)},a.prototype.getMissingPropertyList=function(){for(var t=this.getProperties("missing"),e=[],r=0;r<t.length;r++){var n=this.getPropertyClassFrame(t[r]);if(n)var i={label:n.getLabel(),value:t[r]};else i={label:t[r],value:t[r]};e.push(i)}return e},a.prototype.getPossibleContainedClasses=function(){var t=[];return function e(r){r.type&&"class_choice"===r.type&&e(r.operands),Array.isArray(r)||(r=[r]);for(var n=0;n<r.length;n++)r[n].domain&&-1===t.indexOf(r[n].domain)&&t.push(r[n].domain),r[n].frame&&e(r[n].frame)}(Object.values(this.classframes)),t},a.prototype.getDocumentLinks=function(){for(var t=[],e=this.getProperties("filled"),r=0;r<e.length;r++)for(var n=this.properties[e[r]],i=0;i<n.values.length;i++){var o=n.values[i];if(o.isObject()&&o.getDocumentLinks)for(var s=o.getDocumentLinks(),a=0;a<s.length;a++)-1===t.indexOf(s[a])&&t.push(s[a]);else if(o.isDocument()){var u=o.get();-1===t.indexOf(u)&&t.push(u)}}return t},a.prototype.getFilledPropertyList=function(){for(var t=this.getProperties("filled"),e=[],r=0;r<t.length;r++){var n=this.getPropertyClassFrame(t[r]);if(n)var i={label:n.getLabel(),value:t[r]};else i={label:t[r],value:t[r]};e.push(i)}return e},a.prototype.fillFromSchema=function(t){t&&(this.subjid=t),t=t||i.genBNID("".concat(i.urlFragment(this.cls),"_"));var e={};if(this.classframes)for(var r=0,n=Object.keys(this.classframes);r<n.length;r++){var o=n[r],s=this.getPropertyClassFrame(o);e[o]=new u(o,s,this),e[o].fillFromSchema(t)}this.properties=e,this.originalFrames=[];for(var a=0,c=Object.keys(this.properties);a<c.length;a++){var h=c[a];this.originalFrames.push(this.properties[h].getAsFrames())}return this},a.prototype.clone=function(t){var e={},r=new a(this.cls,!1,!1,this.parent);r.classframes=this.classframes,r.subjid=t;for(var n=0,i=Object.keys(this.properties);n<i.length;n++){var o=i[n];e[o]=this.properties[o].clone()}return r.properties=e,r},a.prototype.getChild=function(t,e){for(var r=this.getProperty(e);0<r.values.length;r++)if(r.values[0].isObject()&&r.values[0].subject===t)return r.values[0];if(!e)for(var n=0,i=Object.keys(this.properties);n<i.length;n++)for(var o=i[n],s=0;s<this.properties[o].values.length;s+=1)if(this.properties[o].values[s].subject()===t)return this.properties[o].values[s];return!1},a.prototype.addProperty=function(t,e){"object"!==n(t)&&(t=i.unshorten(t));var r=this.getPropertyClassFrame(t),o=!1;if(r){var s=new u(t,r,this);if(r.isObject()){r.isClassChoice()||(o=r.createEmpty(i.genBNID("".concat(i.urlFragment(r.range),"_")))),e&&(o=r.createEmptyChoice(e,i.genBNID("".concat(i.urlFragment(e),"_"))));var a=r.getClassChoices();a&&a.length&&(o=r.createEmptyChoice(a[0],i.genBNID("".concat(i.urlFragment(a[0]),"_"))))}else o=r.createEmpty();if(o&&s.addValueFrame(o),void 0===this.properties[t]){if("object"===n(t))var c=t.property;else c=t;this.properties[c]=s}return s.status="new",s}return!1},a.prototype.addPropertyValue=function(t,e){return t=i.unshorten(t),this.properties[t]?this.properties[t].addValue(e):null},a.prototype.removeProperty=function(t){t=i.unshorten(t),void 0!==this.properties[t]&&delete this.properties[t]},a.prototype.removePropertyValue=function(t,e,r){t=i.unshorten(t);var n=this.properties[t];n.removeValue(e,r),0===n.values.length&&this.removeProperty(t)},a.prototype.error=function(t){this.errors||(this.errors=[]),this.errors.push({type:"Internal Object Frame Error",msg:t})},a.prototype.extract=function(){var t={};for(var e in this.properties){var r=this.properties[e].extract();i.empty(r)||(void 0===t[e]&&(t[e]=[]),t[e]=t[e].concat(r)),t[e]&&1===t[e].length&&(t[e]=t[e][0])}return(!i.empty(t)||!this.parent)&&this.extractJSONLD(t)},a.prototype.extractJSONLD=function(t){return t["@type"]=this.cls,"_:"!==this.subject()&&(t["@id"]=this.subject()),this.jsonld_context&&(t["@context"]=this.jsonld_context),t},a.prototype.subject=function(){return this.subjid||""},a.prototype.get=a.prototype.subject,a.prototype.set=function(t){this.subjid=t},a.prototype.isObject=function(){return!0},a.prototype.isProperty=function(){return!1},a.prototype.isData=function(){return!1},a.prototype.isClassChoice=function(){return this.frame&&"class_choice"===this.frame.type},a.prototype.subjectClass=function(){return this.cls},a.prototype.depth=function(){return this.parent?this.parent.depth()+1:0},a.prototype.getProperty=function(t){return this.properties[t]},a.prototype.first=function(t){if(this.properties&&this.properties[t])return this.properties[t].first()},a.prototype.property=function(t){return!!this.parent&&this.parent.property()},a.prototype.parentObject=function(){return!(!this.parent||!this.parent.parent)&&this.parent.parent},a.prototype.root=function(){return!this.parent},a.prototype.renderProperties=function(){for(var t=this.sortProperties(),e=[],r=0;r<t.length;r++)if(this.properties[t[r]].render){var n=this.properties[t[r]].render(this.properties[t[r]]);n&&e.push(n)}return e},a.prototype.sortProperties=function(){var t=this,e=Object.keys(this.properties);return this.compare?e.sort((function(e,r){return t.compare(e,r,t)})):e.sort((function(e,r){return t.standardCompare(e,r,t)}))},a.prototype.standardCompare=function(t,e,r){return"rdfs:label"===i.shorten(t)?-1:"rdfs:label"===i.shorten(e)?1:"rdfs:comment"===i.shorten(t)?-1:"rdfs:comment"===i.shorten(e)?1:r.properties[t].isData()&&r.properties[e].isObject()?-1:r.properties[e].isData()&&r.properties[t].isObject()?1:0},a.prototype.cardControlAllows=function(t){if(!this.parent)return!0;if(this.parent.cframe.hasRestriction()){var e=this.parent.cframe.restriction,r=this.parent.values.length;if(("add"===t||"clone"===t)&&e.max&&r>=e.max)return!1;if("delete"===t&&e.min&&r<=e.min)return!1}return!0},a.prototype.isUpdated=function(){var t=0;for(var e in this.properties){if(this.originalFrames[t]!==e)return!0;if(this.properties[e].isUpdated())return!0;t++}return t!==this.originalFrames.length},a.prototype.isNew=function(){return"_:"===this.subject().substring(0,2)},a.prototype.getSummary=function(){var t={status:"ok"};for(var e in this.isUpdated()&&(t.status="updated"),this.isNew()&&(t.status="new"),t.propcount=0,this.properties)t.propcount++;return t.long="".concat(t.propcount," properties"),t},a.prototype.saveQuery=function(){var t=s.update_object(this.extract());return this.pathToDoc(t),t},a.prototype.pathToDoc=function(t){t.add_triple(this.subjid,"type",this.cls),this.parent&&(t.add_triple(this.parent.subject(),"type",this.parent.subjectClass()),t.add_triple(this.parent.subject(),this.parent.predicate,this.subjid),this.parent.parent&&this.parent.parent.pathToDoc(t))},a.prototype.deleteQuery=function(){var t=s.delete_object(this.subjid);return this.parent&&t.delete_triple(this.parent.subject(),this.parent.predicate,this.subjid),t},u.prototype.addJSONLDDocument=function(t){if(this.cframe.isData())if(Array.isArray(t))for(var e=0;e<t.length;e++){var r=new c(t[e],this,this.values.length);this.values.push(r)}else r=new c(t,this,this.values.length),this.values.push(r);else if(Array.isArray(t))for(e=0;e<t.length;e++){var n=new a(i.unshorten(t[e]["@type"]),t[e],this.cframe.frame,this);this.values.push(n)}else{var o=new a(t["@type"],t,this.cframe.frame,this);this.values.push(o)}},u.prototype.addFrame=function(t){if(this.cframe.isData()){var e=new c(t,this,this.values.length);this.values.push(e)}else{var r=new a(this.range(),this.cframe.frame,t.frame,this,t);this.values.push(r)}},u.prototype.addValueFrame=function(t){t&&(t.parent=this,t.index=this.values.length,this.values.push(t))},u.prototype.addValue=function(t){var e=this.createEmpty();return t&&e.set(t),this.addValueFrame(e),e},u.prototype.fillFromSchema=function(t){if(this.isData()||this.isObject()&&!this.isClassChoice()){var e=[];if(this.cframe.hasRestriction()&&this.cframe.restriction.min)for(var r=0;r<this.cframe.restriction.min;r+=1){var n;(n=this.createEmpty(t)).parent=this,e.push(n)}else(n=this.createEmpty(t)).parent=this,e.push(n);this.values=e}else if(this.isClassChoice()){var o=this.cframe.getClassChoices();if(o&&o.length){var s=this.cframe.createEmptyChoice(o[0],i.genBNID("".concat(i.urlFragment(o[0]),"_")));s.parent=this,this.values=[s]}}},u.prototype.isData=function(){return this.cframe.isData()},u.prototype.isObject=function(){return this.cframe.isObject()},u.prototype.isProperty=function(){return!0},u.prototype.property=function(){return this.predicate},u.prototype.extract=function(){for(var t=[],e=function(e){if(e["@value"]){for(var r=0;r<t.length;r++)if(t[r]["@value"]&&t[r]["@value"]===e["@value"]&&t[r]["@type"]&&t[r]["@type"]===e["@type"])return!0;return!1}if(e["@id"]){for(r=0;r<t.length;r++)if(t[r]["@id"]&&t[r]["@id"]===e["@id"])return!0;return!1}},r=0;r<this.values.length;r++){var n=this.values[r].extract();""===n||!1===n||void 0===n||e(n)||t.push(n)}return t},u.prototype.subject=function(){return!!this.parent&&this.parent.subject()},u.prototype.subjectClass=function(){return!!this.parent&&this.parent.subjectClass()},u.prototype.depth=function(){return!!this.parent&&this.parent.depth()},u.prototype.updated=function(){return!!this.parent&&this.parent.childUpdated()},u.prototype.range=function(){return this.cframe?this.cframe.range:""},u.prototype.getLabel=function(){return this.cframe?this.cframe.getLabel():this.predicate.getLabel()},u.prototype.getComment=function(){return!!this.cframe&&this.cframe.getComment()},u.prototype.hasCardinalityRestriction=function(){return!!this.cframe&&this.cframe.hasRestriction()},u.prototype.getRestriction=function(){return!!this.cframe&&this.cframe.restriction},u.prototype.isClassChoice=function(){return!!this.cframe&&this.cframe.isClassChoice()},u.prototype.deletePropertyValue=function(t,e){this.parent.removePropertyValue(this.property(),t,e)},u.prototype.removeValue=function(t,e){for(var r=[],n=0;n<this.values.length;n++)this.values[n].index!==t.index&&r.push(this.values[n]);this.values=r},u.prototype.get=function(){for(var t=[],e=0;e<this.values.length;e++)if(this.values[e]){var r=this.values[e].get();r&&t.push(r)}return t},u.prototype.set=function(t){for(var e=0;e<this.values.length;e++)this.values[e]&&this.values[e].set(t)},u.prototype.clear=function(){for(var t=0;t<this.values.length;t++)this.values[t].clear()},u.prototype.clone=function(){for(var t=[],e=new u(this.predicate,this.cframe,this.parent),r=0;r<this.values.length;r++)t.push(this.values[r].clone());return e.values=t,e},u.prototype.getAsFrames=function(){for(var t=[],e=0;e<this.values.length;e++)this.values[e]&&(this.isData()?t.push(this.values[e].getAsFrame()):t=t.concat(this.values[e].getAsFrames()));return t},u.prototype.createEmpty=function(){if(this.cframe.isData()){var t=this.cframe.copy(this.subject());return t.set(""),t.status="new",t}if(this.cframe.isObject()){if(!this.cframe.isClassChoice()){var e=this.cframe.createEmpty(i.genBNID("".concat(i.urlFragment(this.cframe.range),"_")));return e.status="new",e}var r=new h(this.cframe);return r.status="new",r}},u.prototype.mfilter=function(t,e){(new o).testRules(t,this,e);for(var r=0;r<this.values.length;r++)this.values[r].mfilter(t,e);return this},u.prototype.first=function(){if(this.values&&this.values[0])return this.values[0].get()},u.prototype.renderValues=function(){for(var t=this.sortValues(),e=[],r=0;r<t.length;r++)if(t[r]&&t[r].render){var n=t[r].render(t[r]);n&&e.push(n)}return e},u.prototype.sortValues=function(){var t=this;return this.compare?this.values.sort((function(e,r){return t.compare(e,r,t)})):this.values},u.prototype.cardControlAllows=function(t){if(this.cframe.hasRestriction()){var e=this.cframe.restriction,r=this.values.length;if(("add"===t||"clone"===t)&&e.max&&r>=e.max)return!1;if("delete"===t&&e.min)return!1}return!0},u.prototype.isUpdated=function(){return!0},u.prototype.saveQuery=function(){for(var t=s.query(),e=0;e<this.values.length;e++)t.and(this.values[e].saveQuery());return this.parent.pathToDoc(t),t},u.prototype.deleteQuery=function(){for(var t=s.query(),e=0;e<this.values.length;e++)t.and(this.values[e].deleteQuery());return t},c.prototype.loadParent=function(t,e){this.parent=t,this.type=t.type,this.domainValue=t.subject(),this.subjid=t.subject()||!1,this.domain=t.cframe?t.cframe.domain:t.subjectClass(),this.predicate=t.cframe?t.cframe.predicate:t.property(),this.frame=!!t.cframe&&t.cframe.frame,this.label=t.getLabel(),this.comment=t.getComment(),this.range=!(!t||!t.cframe)&&t.cframe.range;var r=!!t.cframe&&t.cframe.restriction;this.restriction=!1,r&&"object"===n(r)&&(this.restriction=new l(r))},c.prototype.copy=function(t){var e=new c;return e.parent=this.parent,e.range=this.range,e.rangeValue=this.rangeValue,e.index=this.index,e.type=this.type,e.domain=this.domain,e.domainValue=t||this.domainValue,e.predicate=this.predicate,e.frame=this.frame,e.label=this.label,e.comment=this.comment,this.restriction&&(e.restriction=this.restriction),this.language&&(e.language=this.language),e},c.prototype.mfilter=function(t,e){return(new o).testRules(t,this,e),this},c.prototype.reset=function(){this.set(this.originalValue)},c.prototype.clone=function(){this.parent.addPropertyValue(this.get())},c.prototype.depth=function(){return!!this.parent&&this.parent.depth()},c.prototype.property=function(){return!!this.parent&&this.parent.property()},c.prototype.subject=function(){return!!this.parent&&this.parent.subject()},c.prototype.subjectClass=function(){return!!this.parent&&this.parent.subjectClass()},c.prototype.type=function(){return!!this.range&&this.range},c.prototype.isValidType=function(t){return-1!==["datatypeProperty","objectProperty","restriction "].indexOf(t)},c.prototype.getAsFrame=function(){var t={type:this.type,property:this.property()};return this.range&&(t.range=this.range),this.rangeValue&&(t.rangeValue=this.rangeValue),this.domain&&(t.domain=this.domain),this.domainValue&&(t.domainValue=this.domainValue),this.frame&&(t.frame=this.frame),this.label&&(t.label=this.label),this.comment&&(t.comment=this.comment),t},c.prototype.hasRestriction=function(){return!!this.restriction&&this.restriction.hasCardRestriction()},c.prototype.getLabel=function(){var t="";return"rdfs:label"===i.shorten(this.predicate)?"Name":"rdfs:comment"===i.shorten(this.predicate)?"Description":(this.label&&"object"===n(this.label)&&(t=this.label["@value"]),this.label&&"string"==typeof this.label&&(t=this.label),!t&&this.predicate&&(t=i.labelFromURL(this.predicate)),t||(t=i.labelFromURL(this.cls)),t)},c.prototype.getType=function(){return this.range?this.range:!(!this.rangeValue||!this.rangeValue["@type"])&&this.rangeValue["@type"]},a.prototype.getLabel=c.prototype.getLabel,c.prototype.getComment=function(){var t="";return this.comment&&"object"===n(this.comment)&&(t=this.comment["@value"]),this.comment&&"string"==typeof this.comment&&(t=this.comment),t},a.prototype.getComment=c.prototype.getComment,c.prototype.error=function(t){return t&&(this.err=t),this.errors||(this.errors=[]),this.errors.push({type:"Internal Data Frame Error",msg:t}),this.err},c.prototype.isValid=function(){return this.type&&this.isValidType(this.type)?this.predicate?this.domain?this.range?!(this.isObjectProperty()&&(!this.frame||"object"!==n(this.frame))&&(this.error("Missing Object Frame"),1)):(this.error("Missing Frame Range"),!1):(this.error("Missing Frame Domain"),!1):(this.error("Missing Frame Property"),!1):(this.error("Missing or Illegal Frame Type ".concat(this.type)),!1)},c.prototype.isObjectProperty=function(){return"objectProperty"===this.type},c.prototype.isData=function(){return!0},c.prototype.isDatatypeProperty=function(){return"datatypeProperty"===this.type},c.prototype.isLogic=function(){return"and"===this.type||"or"===this.type||"xor"===this.type},c.prototype.isRestriction=function(){return"restriction"===this.type},c.prototype.ftype=function(){return this.isDocument()?"document":this.isDatatypeProperty()?"data":this.isChoice()?"oneOf":this.isObject()?"object":this.isLogic()?"logic":this.isClassChoice()?"class_choice":void 0},c.prototype.isClassChoice=function(){return this.frame&&"class_choice"===this.frame.type},c.prototype.isString=function(){return this.range===i.getStdURL("xsd","string")},c.prototype.getChoiceOptions=function(){for(var t=[],e=0;e<this.frame.elements.length;e+=1){var r={};this.frame.elements[e].label?r.label=this.frame.elements[e].label["@value"]:r.label=i.labelFromURL(this.frame.elements[e].class),r.value=this.frame.elements[e].class,t.push(r)}return t},c.prototype.lang=function(){return this.language||"en"},c.prototype.isChoice=function(){return this.frame&&"oneOf"===this.frame.type},c.prototype.isDocument=function(){return this.frame&&"document"===this.frame.type},c.prototype.isObject=function(){return this.isObjectProperty()&&this.frame&&!(this.isChoice()||this.isDocument())},c.prototype.isProperty=function(){return!1},c.prototype.getTypeShorthand=function(){return this.isDocument()?"document":this.isChoice()?"choice":i.getShorthand(this.getType())||this.getType()},c.prototype.get=function(){return this.contents?this.contents:this.isDatatypeProperty()&&this.rangeValue&&void 0!==this.rangeValue["@value"]?this.rangeValue["@value"]:(this.isChoice()||this.isDocument())&&this.rangeValue&&this.rangeValue["@id"]?this.rangeValue["@id"]:""},c.prototype.set=function(t,e){e&&(t=e(t,this)),this.contents=t,(this.isChoice()||this.isDocument())&&(this.frame.domainValue=t),this.isDatatypeProperty()&&(this.rangeValue||(this.rangeValue={"@type":this.range}),this.rangeValue["@value"]=t)},c.prototype.clear=function(){(this.isDocument()||this.isChoice()||this.isDatatypeProperty())&&this.set("")},c.prototype.cardControlAllows=function(t){if(this.parent.cframe.hasRestriction()){var e=this.parent.cframe.restriction,r=this.parent.values.length;if(("add"===t||"clone"===t)&&e.max&&r>=e.max)return!1;if("delete"===t&&e.min&&r<=e.min)return!1}return!0},c.prototype.extract=function(){var t=this.get();if(""!==t&&!1!==t){var e={};return this.isDocument()||(e["@type"]=this.getType()),this.isChoice()||this.isDocument()?e["@id"]=t:e["@value"]=t,this.language&&(e["@language"]=this.language),e}return t},c.prototype.saveQuery=function(t,e,r){var n,i;return""!==t&&(this.isDocument()||this.isChoice()?n=s.iri(t):((n={"@value":t})["@type"]=e||this.range,(r||this.language)&&(n["@language"]=r||this.language)),i=""!==this.get()?s.update_triple(this.parent.subject(),this.predicate,n,this.extract()):s.add_triple(this.parent.subject(),this.predicate,n),this.parent.parent&&this.parent.parent.pathToDoc(i),i)},c.prototype.deleteQuery=function(){return s.delete_triple(this.subject(),this.predicate,this.extract())},h.prototype=c.prototype,h.prototype.load=function(t){"object"===n(t)?(this.domainValue=t.domainValue,this.subjid=!!t.domainValue&&t.domainValue,this.type=t.type,this.domain=t.domain,this.predicate=t.property,this.frame=t.frame,this.comment=t.comment?t.comment["@value"]:"",this.range=t.range,this.rangeValue=t.rangeValue):this.error("No frame passed to load")},h.prototype.loadFromJSONLD=function(t,e){t[e]&&(this.predicate=i.unshorten(e),this.type=t[e]["@value"]?"datatypeProperty":"objectProperty",this.range=i.unshorten(t[e]["@type"]),this.rangeValue=t[e]["@id"]?t[e]["@id"]:t[e]),this.domain=i.unshorten(t["@type"]),this.domainValue=i.unshorten(t["@id"]),this.label=i.labelFromURL(this.predicate),this.comment=""},h.prototype.isClassChoice=function(){return this.frame&&"class_choice"===this.frame.type},h.prototype.loadFromObjectFrame=function(t,e){this.type="objectProperty",this.predicate=t.property,this.range=t.range,this.rangeValue=e.subjid,this.domain=t.cls,this.domainValue=t.subjid,this.label=t.getLabel(),this.comment=t.getComment(),this.restriction=t.restriction},h.prototype.createEmptyChoice=function(t,e){var r=this.getChosenClassFrames(t),n=new a(t);e&&(n.subjid=e),n.loadClassFrames(r);var i=n.fillFromSchema();return i.status="new",i},h.prototype.getChosenClassFrames=function(t){for(var e=[],r=0;r<this.frame.operands.length;r+=1)for(var n=0;n<this.frame.operands[r].length;n+=1)t===this.frame.operands[r][n].domain&&(e=e.concat(this.frame.operands[r][n]));return e},h.prototype.createEmpty=function(t){var e;if(this.isObject()){e=this.isClassChoice()?new a(this.predicate):new a(this.range),t&&(e.subjid=t),e.loadClassFrames(this.frame);var r=e.fillFromSchema();return r.status="new",r}if(this.isData()){var n=this.copy(t);return n.set(""),n.status="new",n}},h.prototype.cloneDataFrame=function(t,e){return e},h.prototype.clone=function(t,e){if(this.isObject())console.log("cannot clone class frame");else if(this.isData())return this.cloneDataFrame(t,e)},h.prototype.getClassChoices=function(){return[]},h.prototype.getChosenClassFrame=function(t,e){for(var r=0;r<this.frame.operands.length;r+=1){var n=this.frame.operands[r];if(n.class&&t===n.class)return new h(n,e,this.label)}return!1},h.prototype.getChosenFrame=function(t){return t},h.prototype.isData=function(){return this.isDocument()||this.isChoice()||this.isDatatypeProperty()},l.prototype.hasCardRestriction=function(){return 0!==this.min||0!==this.max},l.prototype.loadRestriction=function(t){if(void 0!==t.cardinality)this.max=t.cardinality,this.min=t.cardinality;else if(void 0!==t.maxCardinality)this.max=t.maxCardinality;else if(void 0!==t.minCardinality)this.min=t.minCardinality;else if(void 0!==t.type&&"and"===t.type&&"object"===n(t.operands))for(var e=0;e<t.operands.length;e+=1){var r=new l(t.operands[e]);(0===this.max&&r.max>0||this.max>0&&r.max>0&&r.max<this.max)&&(this.max=r.max),(0===this.min&&r.min>0||this.min>0&&r.min>0&&r.min>this.min)&&(this.min=r.min)}},t.exports=a},285(t,e,r){var n=r(4876),i=r(3540);function o(){n.ViewConfig.call(this),this.type="stream"}function s(){n.WOQLViewRule.call(this)}Object.setPrototypeOf(o.prototype,n.ViewConfig.prototype),o.prototype.create=function(t){return new i(t,this)},o.prototype.row=function(){var t=(new s).scope("row");return this.rules.push(t),t},o.prototype.template=function(t){return t?(this.mtemplate=t,this):this.mtemplate},o.prototype.prettyPrint=function(){var t="view = View.stream();\n";void 0!==this.template()&&(t+="view.template(".concat(JSON.stringify(this.template()),")\n"));for(var e=0;e<this.rules.length;e++)t+="view.".concat(this.rules[e].prettyPrint(),"\n");return t},o.prototype.loadJSON=function(t,e){for(var r=[],n=0;n<e.length;n++){var i=new s;i.json(e[n]),r.push(i)}this.rules=r,t.template&&(this.mtemplate=t.template)},o.prototype.json=function(){for(var t=[],e=0;e<this.rules.length;e++)t.push(this.rules[e].json());var r={};return this.mtemplate&&(r.template=this.mtemplate),{stream:r,rules:t}},Object.setPrototypeOf(s.prototype,n.WOQLViewRule.prototype),s.prototype.template=function(t){return t?(this.rule.template=t,this):this.rule.template},t.exports=o},7513(t,e,r){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(4876),o=r(106),s=r(4557);function a(){i.ViewConfig.call(this),this.type="table"}function u(){i.WOQLViewRule.call(this)}Object.setPrototypeOf(a.prototype,i.ViewConfig.prototype),a.prototype.create=function(t){return new o(t,this)},a.prototype.json=function(){for(var t=[],e=0;e<this.rules.length;e++)t.push(this.rules[e].json());var r={};return void 0!==this.column_order()&&(r.column_order=this.column_order()),void 0!==this.pagesize()&&(r.pagesize=this.pagesize()),void 0!==this.renderer()&&(r.renderer=this.renderer()),void 0!==this.filter()&&(r.filter=this.filter()),void 0!==this.filterable()&&(r.filterable=this.filterable()),void 0!==this.pager()&&(r.pager=this.pager()),void 0!==this.bindings()&&(r.bindings=this.bindings()),void 0!==this.page()&&(r.page=this.page()),void 0!==this.changesize()&&(r.changesize=this.changesize()),{table:r,rules:t}},a.prototype.loadJSON=function(t,e){var r,i=[];if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=new u;s.json(e[o]),i.push(s)}return this.rules=i,t?(void 0!==t.column_order&&this.column_order.apply(this,function(t){if(Array.isArray(t))return n(t)}(r=t.column_order)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),void 0!==t.pagesize&&this.pagesize(t.pagesize),void 0!==t.renderer&&this.renderer(t.renderer),void 0!==t.filter&&this.filter(t.filter),void 0!==t.filterable&&this.filterable(t.filterable),void 0!==t.bindings&&this.bindings(t.bindings),void 0!==t.pager&&this.pager(t.pager),void 0!==t.page&&this.page(t.page),void 0!==t.changesize&&this.changesize(t.changesize),this):this},a.prototype.prettyPrint=function(){var t="view = View.table();\n";void 0!==this.column_order()&&(t+="view.column_order('".concat(this.column_order(),"')\n")),void 0!==this.pagesize()&&(t+="view.pagesize(".concat(this.pagesize(),")\n")),void 0!==this.renderer()&&(t+="view.renderer('".concat(this.renderer(),"')\n")),void 0!==this.pager()&&(t+="view.pager(".concat(this.pager(),")\n")),void 0!==this.page()&&(t+="view.page(".concat(this.page(),")\n")),void 0!==this.changesize()&&(t+="view.changesize(".concat(this.changesize(),")\n"));for(var e=0;e<this.rules.length;e++){var r=this.rules[e].prettyPrint();r&&(t+="view.".concat(r,"\n"))}return t},a.prototype.filterable=function(t){return t||!1===t?(this.tfilterable=t,this):this.tfilterable},a.prototype.filter=function(t){return t?(this.tfilter=t,this):this.tfilter},a.prototype.renderer=function(t){return t?(this.trenderer=t,this):this.trenderer},a.prototype.header=function(t){return void 0===t?this.theader:(this.theader=t,this)},a.prototype.column_order=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return void 0===e||0===e.length?this.order:(this.order=s.removeNamespacesFromVariables(e),this)},a.prototype.pager=function(t){return void 0===t?this.show_pager:(this.show_pager=t,this)},a.prototype.changesize=function(t){return void 0===t?this.change_pagesize:(this.change_pagesize=t,this)},a.prototype.pagesize=function(t){return void 0===t?this.show_pagesize:(this.show_pagesize=t,this)},a.prototype.page=function(t){return void 0===t?this.show_pagenumber:(this.show_pagenumber=t,this)},a.prototype.column=function(){for(var t=(new u).scope("column"),e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.setVariables(r),this.rules.push(t),t},a.prototype.row=function(){var t=(new u).scope("row");return this.rules.push(t),t},Object.setPrototypeOf(u.prototype,i.WOQLViewRule.prototype),u.prototype.header=function(t){return void 0===t?this.rule.header:(this.rule.header=t,this)},u.prototype.filter=function(t){return void 0===t?this.rule.filter:(this.rule.filter=t,this)},u.prototype.filterable=function(t){return void 0===t?this.rule.filterable:(this.rule.filterable=t,this)},u.prototype.width=function(t){return void 0===t?this.rule.width:(this.rule.width=t,this)},u.prototype.maxWidth=function(t){return void 0===t?this.rule.maxWidth:(this.rule.maxWidth=t,this)},u.prototype.minWidth=function(t){return void 0===t?this.rule.minWidth:(this.rule.minWidth=t,this)},u.prototype.unsortable=function(t){return void 0===t?this.rule.unsortable:(this.rule.unsortable=t,this)},u.prototype.uncompressed=function(t){return void 0===t?this.rule.uncompressed:(this.rule.uncompressed=t,this)},u.prototype.prettyPrint=function(){var t=i.WOQLViewRule.prototype.prettyPrint.apply(this);return void 0!==this.header()&&(t+=".header(".concat(this.header(),")")),this.sortable()&&(t+=".sortable(true)"),void 0!==this.width()&&(t+=".width(".concat(this.width(),")")),void 0!==this.maxWidth()&&(t+=".maxWidth(".concat(this.maxWidth(),")")),void 0!==this.minWidth()&&(t+=".minWidth(".concat(this.minWidth(),")")),t},t.exports=a},1240(module,__unused_webpack_exports,__webpack_require__){var UTILS=__webpack_require__(4557);function TerminusRule(){}function TerminusPattern(t){}TerminusRule.prototype.literal=function(t){return void 0===t?this.pattern.literal:(this.pattern.literal=t,this)},TerminusRule.prototype.type=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return void 0===e||0===e.length?this.pattern.type:(this.pattern.type=e,this)},TerminusRule.prototype.scope=function(t){return void 0===t?this.pattern.scope:(this.pattern.scope=t,this)},TerminusRule.prototype.value=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return void 0===e?this.pattern.value:(this.pattern.value=e,this)},TerminusRule.prototype.json=function(t){if(!t){var e={};return this.pattern&&(e.pattern=this.pattern.json()),this.rule&&(e.rule=this.rule),e}return t.pattern&&this.pattern.setPattern(t.pattern),t.rule&&(this.rule=t.rule),this},TerminusPattern.prototype.setPattern=function(t){void 0!==t.literal&&(this.literal=t.literal),t.type&&(this.type=t.type),t.scope&&(this.scope=t.scope),t.value&&(this.value=t.value)},TerminusPattern.prototype.json=function(){var t={};return void 0!==this.literal&&(t.literal=this.literal),this.type&&(t.type=this.type),this.scope&&(t.scope=this.scope),this.value&&(t.value=this.value),t},TerminusPattern.prototype.testBasics=function(t,e){if(this.scope&&t&&this.scope!==t)return!1;if(this.type){var r=e["@type"];if(!r||!this.testValue(r,this.type))return!1}return!(void 0!==this.literal&&this.literal!==!(void 0===e["@type"])||void 0!==this.value&&!this.testValue(e,this.value))},TerminusPattern.prototype.testValue=function(t,e){if(!t)return null;var r=t["@value"]?t["@value"]:t;if("function"==typeof e)return e(r);e&&!Array.isArray(e)&&(e=[e]);for(var n=0;n<e.length;n++){var i=e[n];if("string"==typeof r){if(this.stringMatch(i,r))return!0}else if("number"==typeof r&&this.numberMatch(i,r))return!0}return!1},TerminusPattern.prototype.unpack=function(t,e){var r="";if(e)for(var n=0;n<t.length;n++)"string"==typeof t[n]?r+='"'.concat(t[n],'"'):r+=t[n],n<t.length-1&&(r+=", ");else r='"'.concat(t.join('","'),'"');return r},TerminusPattern.prototype.IDsMatch=function(t,e){return UTILS.compareIDs(t,e)},TerminusPattern.prototype.classIDsMatch=function(t,e){return this.IDsMatch(t,e)},TerminusPattern.prototype.propertyIDsMatch=function(t,e){return this.IDsMatch(t,e)},TerminusPattern.prototype.rangeIDsMatch=function(t,e){return this.IDsMatch(t,e)},TerminusPattern.prototype.valuesMatch=function(t,e){return t===e},TerminusPattern.prototype.numberMatch=function(vala,valb){if("string"==typeof vala)try{return eval(valb+vala)}catch(t){return!1}return vala===valb},TerminusPattern.prototype.stringMatch=function(t,e){return"/"===t.substring(0,1)?new RegExp(t.substring(1)).test(e):t===e},module.exports={TerminusRule,TerminusPattern}},4876(t,e,r){var n=r(7122).WOQLRule;function i(){this.rules=[]}function o(){n.call(this),this.rule={}}i.prototype.render=function(t){return t&&(this.view_render=t),this.view_render},i.prototype.renderer=function(t){return t&&(this.view_renderer=t),this.view_renderer},i.prototype.getRulesJSON=function(){for(var t=[],e=0;e<this.rules.length;e++)t.push(this.rules[e].json());return t},i.prototype.getBasicJSON=function(){var t={};return this.view_render&&(t.render=this.view_render),this.view_renderer&&(t.renderer=this.view_renderer),this.vbindings&&(t.bindings=this.vbindings),t},i.prototype.loadBasicJSON=function(t){t.render&&(this.view_render=t.view_render),t.renderer&&(this.view_renderer=t.view_renderer),t.bindings&&(this.vbindings=t.bindings)},i.prototype.getBasicprettyPrint=function(){var t="";return void 0!==this.render()&&(t+="view.render(".concat(this.render(),")\n")),void 0!==this.renderer()&&(t+="view.renderer('".concat(this.renderer(),"')\n")),void 0!==this.bindings()&&(t+="view.bindings('".concat(this.bindings(),"')\n")),t},i.prototype.bindings=function(t){return void 0!==t&&(this.vbindings=t),this.vbindings},Object.setPrototypeOf(o.prototype,n.prototype),o.prototype.prettyPrint=function(t){var e="";return this.pattern&&(e=this.pattern.prettyPrint(t)),void 0!==this.color()&&(e+=".color([".concat(this.color().join(","),"])")),void 0!==this.hidden()&&(e+=".hidden(".concat(this.hidden(),")")),void 0!==this.size()&&(e+=".size('".concat(this.size(),"')")),void 0!==this.icon()&&(e+=".icon(".concat(JSON.stringify(this.icon()),")")),void 0!==this.text()&&(e+=".text(".concat(JSON.stringify(this.text()),")")),void 0!==this.border()&&(e+=".border(".concat(JSON.stringify(this.border()),")")),void 0!==this.args()&&(e+=".args(".concat(JSON.stringify(this.args()),")")),void 0!==this.renderer()&&(e+=".renderer('".concat(this.renderer(),"')")),void 0!==this.render()&&(e+=".render(".concat(this.render(),")")),void 0!==this.click()&&(e+=".click(".concat(this.click(),")")),void 0!==this.hover()&&(e+=".hover(".concat(this.hover(),")")),e},o.prototype.json=function(t){if(!t){var e={};return this.pattern&&(e.pattern=this.pattern.json()),e.rule=this.rule,e}return this.rule=t.rule||{},t.pattern&&this.pattern.setPattern(t.pattern),this},o.prototype.size=function(t){return void 0===t?this.rule.size:(this.rule.size=t,this)},o.prototype.color=function(t){return void 0===t?this.rule.color:(this.rule.color=t,this)},o.prototype.icon=function(t){return t?(this.rule.icon=t,this):this.rule.icon},o.prototype.text=function(t){return t?(this.rule.text=t,this):this.rule.text},o.prototype.border=function(t){return t?(this.rule.border=t,this):this.rule.border},o.prototype.renderer=function(t){return void 0===t?this.rule.renderer:(this.rule.renderer=t,this)},o.prototype.render=function(t){return void 0===t?this.rule.render:(this.rule.render=t,this)},o.prototype.click=function(t){return t?(this.rule.click=t,this):this.rule.click},o.prototype.hover=function(t){return t?(this.rule.hover=t,this):this.rule.hover},o.prototype.hidden=function(t){return void 0===t?this.rule.hidden:(this.rule.hidden=t,this)},o.prototype.args=function(t){return void 0===t?this.rule.args:(this.rule.args=t,this)},t.exports={WOQLViewRule:o,ViewConfig:i}},7458(t,e,r){var n=r(9429);function i(t,e){return this.client=t,this.config=e||new n,this}i.prototype.options=function(t){return this.config=t,this},i.prototype.setResult=function(t){return this.result=t,this}},5623(t,e,r){var n=r(1388),i=r(4557),o=r(7122).WOQLRule;function s(t,e){return this.client=t,this.config=e||new n,this.selected=!1,this.cursor=0,this}s.prototype.options=function(t){return this.config=t,this},s.prototype.set=function(t){if(this.selected!==t){this.selected=t;var e=this.config.change;e&&e(t)}},s.prototype.setResult=function(t){this.result=t,this.choices=[];var e=0,r=t.getVariableList();for(!this.config.values()&&r.length&&this.config.values(r[0]),this.config.sort()&&this.result.sort(this.config.sort(),this.config.direction());row=this.result.next();)row&&this.includeRow(row,this.result.cursor)&&this.choices.push(this.rowToChoice(row,e++));return this},s.prototype.includeRow=function(t,e){for(var r=(new o).matchRow(this.config.rules,t,e,"hidden"),n=0;n<r.length;n++)if(r[n].rule.hidden)return!1;return!0},s.prototype.rowToChoice=function(t,e){var r={id:this.getRowID(t)};return r.label=this.getLabelFromBinding(t,e),r.title=this.getTitleFromBinding(t,e),r.selected=this.getSelectedFromBinding(t,e),r},s.prototype.getRowID=function(t){var e=t[this.config.values()];return e["@value"]?e["@value"]:e},s.prototype.getLabelFromBinding=function(t,e){var r=this.getSpecialRenderer(t,e,"label");if(r)return this.renderSpecial(r,t,e);if(this.config.labels()&&t[this.config.labels()]){var n=t[this.config.labels()];if(n["@value"]&&(n=n["@value"]),"system:unknown"!==n)return n}return i.labelFromURL(this.getRowID(t))},s.prototype.getTitleFromBinding=function(t,e){var r=this.getSpecialRenderer(t,e,"title");if(r)return this.renderSpecial(r,t,e);if(this.config.titles()&&t[this.config.titles()]){var n=t[this.config.titles()];if(n["@value"]&&(n=n["@value"]),"system:unknown"!==n)return n}return!1},s.prototype.getSelectedFromBinding=function(t,e){var r=(new o).matchRow(this.config.rules,t,e,"selected");return!(!r||!r.length)&&r[r.length-1].rule.selected},s.prototype.render=function(){if(this.renderer)return this.renderer.render(this)},s.prototype.setRenderer=function(t){return this.renderer=t,this},s.prototype.getSpecialRenderer=function(t,e,r){for(var n=(new o).matchRow(this.config.rules,t,e,r),i=0;i<n.length;i++)if(n[i].rule[r])return n[i].rule[r];return!1},s.prototype.renderSpecial=function(t,e){return t&&"function"==typeof t?t(e):t&&"string"==typeof t?t:void 0},s.prototype.count=function(){return this.result.count()},s.prototype.first=function(){return this.cursor=0,this.choices[this.cursor]},s.prototype.next=function(){var t=this.choices[this.cursor];return this.cursor++,t},s.prototype.prev=function(){if(this.cursor>0)return this.cursor--,this.choices[this.cursor]},t.exports=s},686(t,e,r){var n=r(3065),i=r(4557),o=r(7122).WOQLRule;function s(t,e){this.client=t,this.config=e||new n,this.nodes=[],this.edges=[]}s.prototype.options=function(t){return this.config=t,this},s.prototype.setResult=function(t){this.result=t,this.calculateVariableTypes(t)},s.prototype.calculateVariableTypes=function(){var t=this.result;if(t&&t.length)for(var e=0;e<t.length;e++)this.extractFromBinding(t[e],e);this.edges=this.combineEdges(this.edges),this.nodes=this.combineNodes(this.nodes)},s.prototype.extractFromBinding=function(t,e){if(this.includeRow(t,e)){var r=[];for(var n in t)"string"==typeof t[n]?t[n]&&"system:unknown"!==t[n]&&this.includeNode(n,t)&&r.push(n):t[n]["@value"]&&this.includeLiteralNode(n,t)&&r.push(n);if(0===r.length)return;this.createEdgesFromIDs(r,t);for(var i=0;i<r.length;i++){var o=t[r[i]];o=o["@value"]?o["@value"]:o,this.addAdornedNode(o,r[i],t)}}},s.prototype.addAdornedEdge=function(t,e,r,n,s){t=t["@value"]?t["@value"]:t;for(var a={type:"link",target:e=e["@value"]?e["@value"]:e,source:t,text:e},u=(new o).matchEdge(this.config.rules,s,r,n),c=!1,h=0;h<u.length;h++){var l=u[h].rule;void 0!==l.hidden&&(c=l.hidden),l.size&&(a.size=i.getConfigValue(l.size,s)),l.text&&(a.text=i.getConfigValue(l.text,s)),l.color&&(a.color=i.getConfigValue(l.color,s)),l.icon&&(a.icon=i.getConfigValue(l.icon,s)),l.distance&&(a.distance=i.getConfigValue(l.distance,s)),l.arrow&&(a.arrow=i.getConfigValue(l.arrow,s)),l.symmetric&&(a.symmetric=i.getConfigValue(l.symmetric,s)),l.weight&&(a.weight=i.getConfigValue(l.weight,s))}c||this.edges.push(a)},s.prototype.addAdornedNode=function(t,e,r){for(var n={type:"node",id:t,nodetype:e},s=(new o).matchNode(this.config.rules,r,e,t),a=0;a<s.length;a++){var u=s[a].rule;u.size&&(n.radius=i.getConfigValue(u.size,r)),u.color&&(n.color=i.getConfigValue(u.color,r)),u.charge&&(n.charge=i.getConfigValue(u.charge,r)),u.collisionRadius&&(n.collisionRadius=i.getConfigValue(u.collisionRadius,r)),u.icon&&(n.icon=i.getConfigValue(u.icon,r)),u.text&&(n.text=i.getConfigValue(u.text,r)),u.border&&(n.border=i.getConfigValue(u.border,r))}n.text||("string"==typeof r[e]?n.text=r[e]:r[e]["@value"]&&(n.text=r[e]["@value"])),this.nodes.push(n)},s.prototype.getLiteralOwner=function(t,e,r){var n=this.config.source();if(n&&r[n])return n;var i=this.config.edges();if(i){for(var o=0;o<i.length;o++)if(i[o][1]===e)return i[o][0];return!1}return t[0]},s.prototype.createEdgesFromIDs=function(t,e){if(!(t.length<2)){var r=this.config.source(),n=this.config.edges();if(!r&&n&&n.length)for(var i=0;i<n.length;i++)-1!==t.indexOf(n[i][0])&&-1!==t.indexOf(n[i][1])&&this.addAdornedEdge(e[n[i][0]],e[n[i][1]],n[i][0],n[i][1],e);else{var o=r&&-1!==t.indexOf(r)?r:t[0];for(i=0;i<t.length;i++)t[i]!==o&&this.addAdornedEdge(e[o],e[t[i]],o,t[i],e)}}},s.prototype.getEdges=function(){return this.edges},s.prototype.combineNodes=function(t){for(var e={},r=0;r<t.length;r++){var n=t[r];if(-1!==this.nodes_referenced_by_edges.indexOf(n.id))if(void 0===e[n.id])e[n.id]=n;else for(var i in n)void 0===e[n.id][i]&&(e[n.id][i]=n[i])}return Object.values(e)},s.prototype.combineEdges=function(t){this.nodes_referenced_by_edges=[];for(var e={},r=0;r<t.length;r++){var n=t[r];if(void 0===e[n.source]&&(e[n.source]={}),void 0===e[n.source][n.target])e[n.source][n.target]=n;else for(var i in n)void 0===e[n.source][n.target][i]&&(e[n.source][n.target][i]=n[i]);-1===this.nodes_referenced_by_edges.indexOf(n.source)&&this.nodes_referenced_by_edges.push(n.source),-1===this.nodes_referenced_by_edges.indexOf(n.target)&&this.nodes_referenced_by_edges.push(n.target)}var o=[];for(var i in e)for(var s in e[i])o.push(e[i][s]);return o},s.prototype.getNodes=function(){return this.nodes},s.prototype.includeNode=function(t,e){for(var r=(new o).matchNode(this.config.rules,e,t,!1,"hidden"),n=0;n<r.length;n++)if(r[n].rule.hidden)return!1;return!0},s.prototype.includeLiteralNode=function(t,e){if(!1===this.config.literals())return!1;for(var r=(new o).matchNode(this.config.rules,e,t,!1,"hidden"),n=0;n<r.length;n++)if(r[n].rule.hidden)return!1;return!0},s.prototype.includeRow=function(t,e){for(var r=(new o).matchRow(this.config.rules,t,e,"hidden"),n=0;n<r.length;n++)if(r[n].rule.hidden)return!1;return!0},t.exports=s},1356(t,e,r){var n=r(8111);r(4557),n.prototype.getLimit=function(){return this.getPagingProperty("limit")},n.prototype.setLimit=function(t){return this.setPagingProperty("limit",t)},n.prototype.isPaged=function(t){t=t||this.query;for(var e=0,r=Object.keys(t);e<r.length;e++){var n=r[e];if("limit"===n)return!0;if(-1!==this.paging_transitive_properties.indexOf(n))return this.isPaged(t[n][t[n].length-1])}return!1},n.prototype.getPage=function(){if(this.isPaged()){var t=this.getLimit();if(this.hasStart()){var e=this.getStart();return parseInt(e/t)+1}return 1}return!1},n.prototype.setPage=function(t){var e=this.getLimit()*(t-1);return this.hasStart()?this.setStart(e):this.addStart(e),this},n.prototype.nextPage=function(){return this.setPage(this.getPage()+1)},n.prototype.firstPage=function(){return this.setPage(1)},n.prototype.previousPage=function(){var t=this.getPage()-1;return t>0&&this.setPage(t),this},n.prototype.setPageSize=function(t){return this.setPagingProperty("limit",t),this.hasStart()?this.setStart(0):this.addStart(0),this},n.prototype.hasSelect=function(){return!!this.getPagingProperty("select")},n.prototype.getSelectVariables=function(t){t=t||this.query;for(var e=0,r=Object.keys(t);e<r.length;e++){var n=r[e];if("select"===n)return t[n].slice(0,t[n].length-1);if(-1!==this.paging_transitive_properties.indexOf(n)){var i=this.getSelectVariables(t[n][t[n].length-1]);if(void 0!==i)return i}}},n.prototype.hasStart=function(){return void 0!==this.getPagingProperty("start")},n.prototype.getStart=function(){return this.getPagingProperty("start")},n.prototype.setStart=function(t){return this.setPagingProperty("start",t)},n.prototype.addStart=function(t){if(this.hasStart())this.setStart(t);else{var e={start:[t,this.query]};this.query=e}return this},n.prototype.getPagingProperty=function(t,e){e=e||this.query;for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(i===t)return e[i][0];if(-1!==this.paging_transitive_properties.indexOf(i)){var o=this.getPagingProperty(t,e[i][e[i].length-1]);if(void 0!==o)return o}}},n.prototype.setPagingProperty=function(t,e,r){r=r||this.query;for(var n=0,i=Object.keys(r);n<i.length;n++){var o=i[n];o===t?r[o][0]=e:-1!==this.paging_transitive_properties.indexOf(o)&&this.setPagingProperty(t,e,r[o][r[o].length-1])}return this}},9297(t,e,r){var n=r(4557),i=r(7589);function o(t,e,r){this.bindings=t?t.bindings:[],this.insert_count=t?t.inserts:0,this.delete_count=t?t.deletes:0,this.transaction_retry_count=t?t.transaction_retry_count:0,this.variable_names=!!t&&t["api:variable_names"],this.query=e||i.query(),this.cursor=0}r(1356),o.prototype.formatter=function(t){t=t||this.query.getContext();var e=[];return this.bindings&&this.bindings.length>0&&this.bindings.forEach((function(r){var i={};Object.keys(r).forEach((function(e){var o=r[e];i[e]="string"==typeof o?"system:unknown"!==o?n.shorten(o,t):"":o["@value"]})),e.push(i)})),e},o.prototype.compress=function(t){if(t=t||this.query.getContext())for(var e=0;e<this.bindings.length;e++)for(var r=0,i=Object.keys(this.bindings[e]);r<i.length;r++){var o=i[r],s=n.shorten(o,t),a=this.bindings[e][o];if("string"==typeof this.bindings[e][o])a=n.shorten(this.bindings[e][o],t);else if(Array.isArray(this.bindings[e][o])){a=[];for(var u=0;u<this.bindings[e][o].length;u++){var c=this.bindings[e][o][u];if("string"==typeof c)c=n.shorten(c,t);else if(Array.isArray(c)){for(var h=[],l=0;l<c.length;l++){var p=c[l];"string"==typeof p&&(p=n.shorten(p,t)),h.push(p)}c=h}a.push(c)}}delete this.bindings[e][o],this.bindings[e][s]=a}return this},o.prototype.hasBindings=function(){return!(!this.bindings||!this.count())},o.prototype.hasUpdates=function(){return this.inserts()>0||this.deletes()>0},o.prototype.getBindings=function(){return this.bindings},o.prototype.rows=function(){return this.bindings},o.prototype.getVariableList=function(){return this.variable_names?this.variable_names:this.bindings&&this.bindings[0]?Object.keys(this.bindings[0]):[]},o.prototype.count=function(){return this.bindings.length},o.prototype.inserts=function(){return this.insert_count},o.prototype.deletes=function(){return this.delete_count},o.prototype.first=function(){return this.cursor=0,this.bindings[0]},o.prototype.last=function(){return this.cursor=this.bindings.length-1,this.bindings[this.bindings.length-1]},o.prototype.next=function(){if(this.cursor>=this.bindings.length)return!1;var t=this.bindings[this.cursor];return this.cursor++,t},o.prototype.prev=function(){if(this.cursor>0)return this.cursor--,this.bindings[this.cursor]},o.prototype.sort=function(t,e){var r=this;this.bindings.sort((function(n,i){return r.compareValues(n[t],i[t],e)}))},o.prototype.compareValues=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return t&&e?(void 0!==t["@value"]&&void 0!==e["@value"]&&(t=t["@value"],e=e["@value"]),t>e?r&&"asc"===r?1:-1:e>t?r&&"asc"===r?-1:1:void 0):0},t.exports=o},7122(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(1240),o=r(4557);function s(){i.TerminusRule.call(this),this.pattern=new a}function a(t){i.TerminusPattern.call(this,t)}Object.setPrototypeOf(s.prototype,i.TerminusRule.prototype),s.prototype.setVariables=function(t){return t&&t.length&&(this.pattern.variables=o.removeNamespacesFromVariables(t),this.current_variable=this.pattern.variables[this.pattern.variables.length-1]),this},s.prototype.vars=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.setVariables(e)},s.prototype.v=function(t){return t?(this.current_variable=o.removeNamespaceFromVariable(t),this):this.current_variable},s.prototype.edge=function(t,e){if(this.scope("edge"),t){var r=o.removeNamespaceFromVariable(t);this.setVariables([r]),this.pattern.source=r}if(e){var n=o.removeNamespaceFromVariable(e);t||this.setVariables([n]),this.pattern.target=n}return this},s.prototype.rownum=function(t){return void 0===t?this.pattern.rownum:(this.pattern.rownum=t,this)},s.prototype.in=function(){if(this.current_variable){this.pattern.constraints||(this.pattern.constraints={}),this.pattern.constraints[this.current_variable]||(this.pattern.constraints[this.current_variable]=[]);for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.pattern.constraints[this.current_variable].push(e)}return this},s.prototype.filter=function(t){return this.current_variable&&(this.pattern.constraints||(this.pattern.constraints={}),this.pattern.constraints[this.current_variable]||(this.pattern.constraints[this.current_variable]=[]),this.pattern.constraints[this.current_variable].push(t)),this},s.prototype.matchRow=function(t,e,r,n){for(var i=[],o=0;o<t.length;o++)n&&this.rule&&void 0===this.rule[n]||t[o].pattern.matchRow(e,r)&&i.push(t[o]);return i},s.prototype.matchCell=function(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)i&&this.rule&&void 0===this.rule[i]||t[s].pattern.matchCell(e,r,n)&&o.push(t[s]);return o},s.prototype.matchColumn=function(t,e,r){for(var i=[],o=0;o<t.length;o++)if(!r||!this.rule||void 0!==n(this.rule[r])){var s=t[o];r&&void 0===s.rule[r]||s.pattern.matchColumn(e)&&i.push(s)}return i},s.prototype.matchNode=function(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)i&&this.rule&&void 0===this.rule[i]||t[s].pattern.matchNode(e,r,n)&&o.push(t[s]);return o},s.prototype.matchPair=function(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)i&&this.rule&&void 0===this.rule[i]||t[s].pattern.matchPair(e,r,n)&&o.push(t[s]);return o},s.prototype.matchEdge=s.prototype.matchPair,Object.setPrototypeOf(a.prototype,i.TerminusPattern.prototype),a.prototype.prettyPrint=function(){var t="".concat(this.scope,"('");for(var e in this.variables&&(t+=this.variables.join("', '")),t+="')",void 0!==this.literal&&(t+=".literal(".concat(this.literal,")")),void 0!==this.type&&(t+=".type(".concat(this.unpack(this.type),")")),void 0!==this.value&&(t+=".value(".concat(this.unpack(this.value,!0),")")),this.constraints){t+=".v('".concat(e,"')");for(var r=0;r<this.constraints[e].length;r++)"function"==typeof this.constraints[e][r]?t+=".filter(".concat(this.constraints[e][r],")"):t+=".in(".concat(json.unpack(this.constraints[e][r]),")")}return t},a.prototype.matchRow=function(t,e){return!(void 0!==this.rownum&&void 0!==e&&!this.numberMatch(this.rownum,e)||this.scope&&"row"!==this.scope||!this.testVariableConstraints(t))},a.prototype.matchCell=function(t,e,r){return!(void 0!==this.rownum&&void 0!==r&&!this.numberMatch(this.rownum,r)||!this.testBasics("column",t[e])||this.variables&&this.variables.length&&-1===this.variables.indexOf(e)||!this.testVariableConstraints(t))},a.prototype.matchNode=function(t,e){return!(!this.testBasics("node",t[e])||this.variables&&this.variables.length&&-1===this.variables.indexOf(e)||!this.testVariableConstraints(t))},a.prototype.matchColumn=function(t){return!(this.scope&&"column"!==this.scope||this.variables&&this.variables.length&&-1===this.variables.indexOf(t))},a.prototype.matchPair=function(t,e,r){return!(this.scope&&"edge"!==this.scope||this.source&&this.source!==e||this.target&&this.target!==r||!this.testVariableConstraints(t))},a.prototype.testVariableConstraints=function(t){for(var e in this.constraints)if(!this.testVariableConstraint(e,t[e]))return!1;return!0},a.prototype.testVariableConstraint=function(t,e){if(!this.constraints[t])return!0;for(var r=0;r<this.constraints[t].length;r++)if(!this.testValue(e,this.constraints[t][r]))return!1;return!0},a.prototype.setPattern=function(t){for(var e in t)this[e]=t[e]},a.prototype.json=function(){var t={};return this.scope&&(t.scope=this.scope),this.value&&(t.value=this.value),this.rownum&&(t.rownum=this.rownum),this.variables&&(t.variables=this.variables),this.literal&&(t.literal=this.literal),this.type&&(t.type=this.type),this.constraints&&(t.constraints=this.constraints),this.source&&(t.source=this.source),this.target&&(t.target=this.target),t},t.exports={WOQLRule:s,WOQLPattern:a}},3540(t,e,r){var n=r(285);function i(t,e){return this.client=t,this.config=e||new n,this}i.prototype.options=function(t){return this.config=t,this},i.prototype.setResult=function(t){this.result=t},t.exports=i},106(t,e,r){var n=r(7513),i=r(4557),o=r(7122).WOQLRule,s=r(9297);function a(t,e){return this.client=t,this.config=e||new n,this}function u(t,e){this.datavalue="system:unknown"===t?"":t,this.datatype=e}r(266),a.prototype.options=function(t){return this.config=t,this},a.prototype.setResult=function(t){return this.result=t,this},a.prototype.count=function(){return this.result.count()},a.prototype.first=function(){return this.result.first()},a.prototype.prev=function(){return this.result.prev()},a.prototype.next=function(){return this.result.next()},a.prototype.canAdvancePage=function(){return this.result.count()===this.result.query.getLimit()},a.prototype.canChangePage=function(){return this.canAdvancePage()||this.canRetreatPage()},a.prototype.canRetreatPage=function(){return this.result.query.getPage()>1},a.prototype.getPageSize=function(){return this.result.query.getLimit()},a.prototype.setPage=function(t){return this.result.query.setPage(t)},a.prototype.getPage=function(){return this.result.query.getPage()},a.prototype.setPageSize=function(t){return this.update(this.result.query.setPageSize(t))},a.prototype.nextPage=function(){return this.update(this.result.query.nextPage())},a.prototype.firstPage=function(){return this.update(this.result.query.firstPage())},a.prototype.previousPage=function(){return this.update(this.result.query.previousPage())},a.prototype.getColumnsToRender=function(){if(this.hasColumnOrder())var t=this.getColumnOrder();else t=this.result.getVariableList();var e=this;return t?t.filter((function(t){return!e.hidden(t)})):[]},a.prototype.getColumnHeaderContents=function(t){t=i.removeNamespaceFromVariable(t);var e=(new o).matchColumn(this.config.rules,t,"header");if(e.length){var r=e[e.length-1].rule?e[e.length-1].rule.header:null;return"string"==typeof r?r:"function"==typeof r?r(t):r}return"_"===t[0]?" ":i.labelFromVariable(t)},a.prototype.hidden=function(t){colid=i.removeNamespaceFromVariable(t);var e=(new o).matchColumn(this.config.rules,colid,"hidden");return!!e.length&&e[e.length-1].rule.hidden},a.prototype.update=function(t){var e=this;return t.execute(this.client).then((function(r){var n=new s(r,t);return e.setResult(n),e.notify&&e.notify(n),n}))},a.prototype.hasDefinedEvent=function(t,e,r,n,i){if("row"===r)var s=(new o).matchRow(this.config.rules,t,i,n);else s=(new o).matchCell(this.config.rules,t,e,i,n);return!(!s||!s.length)},a.prototype.getDefinedEvent=function(t,e,r,n,i){if("row"===r)var s=(new o).matchRow(this.config.rules,t,i,n);else s=(new o).matchCell(this.config.rules,t,e,i,n);if(Array.isArray(s)&&s.length>0){if(1===s.length)return s[0].rule[n];var a=s.find((function(t){return void 0!==t.rule[n]||!1===t.rule[n]}));return a&&a.rule?a.rule[n]:void 0}},a.prototype.getRowClick=function(t){return this.getDefinedEvent(t,!1,"row","click")},a.prototype.uncompressed=function(t,e){return this.getDefinedEvent(t,e,"row","uncompressed")},a.prototype.getCellClick=function(t,e){return this.getDefinedEvent(t,e,"column","click")},a.prototype.getRowHover=function(t){return this.getDefinedEvent(t,!1,"row","hover")},a.prototype.getCellHover=function(t,e){return this.getDefinedEvent(t,e,"column","hover")},a.prototype.getColumnOrder=function(){return this.config.column_order()},a.prototype.bindings=function(){return this.config.bindings()},a.prototype.getColumnFilter=function(t){var e=(new o).matchColumn(this.config.rules,t,"filter");return Array.isArray(e)&&e.length>0&&e[0].rule?e[0].rule.filter:null},a.prototype.getColumnDimensions=function(t){var e={},r=(new o).matchColumn(this.config.rules,t,"width");r&&r.length&&r[r.length-1].rule.width&&(e.width=r[r.length-1].rule.width);var n=(new o).matchColumn(this.config.rules,t,"maxWidth");n&&n.length&&(e.maxWidth=n[n.length-1].rule.maxWidth);var i=(new o).matchColumn(this.config.rules,t,"minWidth");return i&&i.length&&(e.minWidth=i[i.length-1].rule.minWidth),e},a.prototype.hasColumnOrder=a.prototype.getColumnOrder,a.prototype.hasCellClick=a.prototype.getCellClick,a.prototype.hasRowClick=a.prototype.getRowClick,a.prototype.hasCellHover=a.prototype.getCellHover,a.prototype.hasRowHover=a.prototype.getRowHover,a.prototype.getRenderer=function(t,e,r){return this.getDefinedEvent(e,t,"column","renderer",r)},a.prototype.isSortableColumn=function(t){return!this.getDefinedEvent(!1,t,"column","unsortable")},a.prototype.isFilterableColumn=function(t){return!1!==this.getDefinedEvent(!1,t,"column","filterable")},a.prototype.renderValue=function(t,e,r,n){if(e&&e["@type"]){t.type=e["@type"];var i=new u(e["@value"],e["@type"],r,n)}else e&&e["@language"]?(t.type="xsd:string",i=new u(e["@value"],t.type,r,n)):e&&"string"==typeof e&&(t.type="id",i=new u(e,"id",r,n));return i?t.renderValue(i):""},u.prototype.value=function(t){return t?(this.datavalue=t,this):this.datavalue},a.prototype.getRendererForDatatype=function(t){return t&&t["@type"]?this.datatypes.getRenderer(t["@type"],t["@value"]):t&&t["@language"]?this.datatypes.getRenderer("xsd:string",t["@value"]):!(!t||"string"!=typeof t)&&this.datatypes.getRenderer("id",t)},a.prototype.getSpecificRender=function(t,e){return this.getDefinedEvent(e,t,"column","render")},t.exports=a},4773(t,e,r){var n=r(7513),i=r(1388),o=r(3065),s=r(9429),a=r(285),u=r(8448),c=r(7122).WOQLRule,h=r(308).FrameRule,l={table:function(){return new n},chart:function(){return new s},graph:function(){return new o},chooser:function(){return new i},stream:function(){return new a},document:function(){return new u},loadConfig:function(t){var e;return t.table?(e=new n).loadJSON(t.table,t.rules):t.chooser?(e=new i).loadJSON(t.chooser,t.rules):t.graph?(e=new o).loadJSON(t.graph,t.rules):t.chart?(e=new s).loadJSON(t.chart,t.rules):t.stream?(e=new a).loadJSON(t.stream,t.rules):t.frame&&(e=new u).loadJSON(t.frame,t.rules),e},rule:function(t){return t&&"frame"===t?new h:new c},pattern:function(t){return t&&"woql"===t?(new c).pattern:(new h).pattern},matchRow:function(t,e,r,n){return(new c).matchRow(t,e,r,n)},matchColumn:function(t,e,r){return(new c).matchColumn(t,e,r)},matchCell:function(t,e,r,n,i){return(new c).matchCell(t,e,r,n,i)},matchNode:function(t,e,r,n,i){return(new c).matchNode(t,e,r,n,i)},matchEdge:function(t,e,r,n,i){return(new c).matchPair(t,e,r,n,i)},matchFrame:function(t,e,r){return(new h).testRules(t,e,r)}};t.exports=l},7589(module,__unused_webpack_exports,__webpack_require__){function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&_setPrototypeOf(i,r.prototype),i}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}var WOQLQuery=__webpack_require__(693),WOQLLibrary=__webpack_require__(601),_require=__webpack_require__(9156),Vars=_require.Vars,Var=_require.Var,Doc=_require.Doc,VarsUnique=_require.VarsUnique,VarUnique=_require.VarUnique,SetVarsUniqueCounter=_require.SetVarsUniqueCounter,typedef=__webpack_require__(7135),WOQLClient=__webpack_require__(266),WOQL={using:function(t,e){return(new WOQLQuery).using(t,e)},comment:function(t,e){return(new WOQLQuery).comment(t,e)},select:function(){var t;return(t=new WOQLQuery).select.apply(t,arguments)},distinct:function(){var t;return(t=new WOQLQuery).distinct.apply(t,arguments)},localize:function(t){return(new WOQLQuery).localize(t)},and:function(){var t;return(t=new WOQLQuery).and.apply(t,arguments)},read_object:function(t,e,r){return(new WOQLQuery).read_document(t,e,r)},read_document:function(t,e){return(new WOQLQuery).read_document(t,e)},insert_document:function(t,e){return(new WOQLQuery).insert_document(t,e)},update_document:function(t,e){return(new WOQLQuery).update_document(t,e)},delete_document:function(t){return(new WOQLQuery).delete_document(t)},or:function(){var t;return(t=new WOQLQuery).or.apply(t,arguments)},from:function(t,e){return(new WOQLQuery).from(t,e)},into:function(t,e){return(new WOQLQuery).into(t,e)},triple:function(t,e,r){return(new WOQLQuery).triple(t,e,r)},added_triple:function(t,e,r){return(new WOQLQuery).added_triple(t,e,r)},removed_triple:function(t,e,r){return(new WOQLQuery).removed_triple(t,e,r)},quad:function(t,e,r,n){return(new WOQLQuery).quad(t,e,r,n)},added_quad:function(t,e,r,n){return(new WOQLQuery).added_quad(t,e,r,n)},removed_quad:function(t,e,r,n){return(new WOQLQuery).removed_quad(t,e,r,n)},sub:function(t,e){return(new WOQLQuery).sub(t,e)},subsumption:function(t,e){return(new WOQLQuery).sub(t,e)},eq:function(t,e){return(new WOQLQuery).eq(t,e)},equals:function(t,e){return(new WOQLQuery).eq(t,e)},substr:function(t,e,r,n,i){return(new WOQLQuery).substr(t,e,r,n,i)},substring:function(t,e,r,n,i){return(new WOQLQuery).substr(t,e,r,n,i)},get:function(t,e){return(new WOQLQuery).get(t,e)},put:function(t,e,r){return(new WOQLQuery).put(t,e,r)},as:function(t,e,r){return(new WOQLQuery).as(t,e,r)},remote:function(t,e){return(new WOQLQuery).remote(t,e)},post:function(t,e,r){return(new WOQLQuery).post(t,e,r)},delete_triple:function(t,e,r){return(new WOQLQuery).delete_triple(t,e,r)},delete_quad:function(t,e,r,n){return(new WOQLQuery).delete_quad(t,e,r,n)},add_triple:function(t,e,r){return(new WOQLQuery).add_triple(t,e,r)},add_quad:function(t,e,r,n){return(new WOQLQuery).add_quad(t,e,r,n)},trim:function(t,e){return(new WOQLQuery).trim(t,e)},evaluate:function(t,e){return(new WOQLQuery).eval(t,e)},eval:function(t,e){return(new WOQLQuery).eval(t,e)},plus:function(){var t;return(t=new WOQLQuery).plus.apply(t,arguments)},minus:function(){var t;return(t=new WOQLQuery).minus.apply(t,arguments)},times:function(){var t;return(t=new WOQLQuery).times.apply(t,arguments)},divide:function(){var t;return(t=new WOQLQuery).divide.apply(t,arguments)},div:function(){var t;return(t=new WOQLQuery).div.apply(t,arguments)},exp:function(t,e){return(new WOQLQuery).exp(t,e)},floor:function(t){return(new WOQLQuery).floor(t)},isa:function(t,e){return(new WOQLQuery).isa(t,e)},like:function(t,e,r){return(new WOQLQuery).like(t,e,r)},less:function(t,e){return(new WOQLQuery).less(t,e)},greater:function(t,e){return(new WOQLQuery).greater(t,e)},opt:function(t){return(new WOQLQuery).opt(t)},optional:function(t){return(new WOQLQuery).opt(t)},unique:function(t,e,r){return(new WOQLQuery).unique(t,e,r)},idgen:function(t,e,r){return(new WOQLQuery).idgen(t,e,r)},idgenerator:function(t,e,r){return(new WOQLQuery).idgen(t,e,r)},idgen_random:function(t,e){return(new WOQLQuery).idgen_random(t,e)},random_idgen:function(t,e){return(new WOQLQuery).idgen_random(t,e)},upper:function(t,e){return(new WOQLQuery).upper(t,e)},lower:function(t,e){return(new WOQLQuery).lower(t,e)},pad:function(t,e,r,n){return(new WOQLQuery).pad(t,e,r,n)},split:function(t,e,r){return(new WOQLQuery).split(t,e,r)},member:function(t,e){return(new WOQLQuery).member(t,e)},concat:function(t,e){return(new WOQLQuery).concat(t,e)},join:function(t,e,r){return(new WOQLQuery).join(t,e,r)},sum:function(t,e){return(new WOQLQuery).sum(t,e)},slice:function(t,e,r,n){return(new WOQLQuery).slice(t,e,r,n)},start:function(t,e){return(new WOQLQuery).start(t,e)},limit:function(t,e){return(new WOQLQuery).limit(t,e)},re:function(t,e,r){return(new WOQLQuery).re(t,e,r)},regexp:function(t,e,r){return(new WOQLQuery).re(t,e,r)},length:function(t,e){return(new WOQLQuery).length(t,e)},not:function(t){return(new WOQLQuery).not(t)},once:function(t){return(new WOQLQuery).once(t)},immediately:function(t){return(new WOQLQuery).immediately(t)},count:function(t,e){return(new WOQLQuery).count(t,e)},typecast:function(t,e,r){return(new WOQLQuery).typecast(t,e,r)},cast:function(t,e,r){return(new WOQLQuery).typecast(t,e,r)},order_by:function(){var t;return(t=new WOQLQuery).order_by.apply(t,arguments)},group_by:function(t,e,r,n){return(new WOQLQuery).group_by(t,e,r,n)},true:function(){return(new WOQLQuery).true()},path:function(t,e,r,n){return(new WOQLQuery).path(t,e,r,n)},size:function(t,e){return(new WOQLQuery).size(t,e)},triple_count:function(t,e){return(new WOQLQuery).triple_count(t,e)},type_of:function(t,e){return(new WOQLQuery).type_of(t,e)},star:function(t,e,r,n){return(new WOQLQuery).star(t,e,r,n)},all:function(t,e,r,n){return(new WOQLQuery).all(t,e,r,n)},node:function(t,e){return(new WOQLQuery).node(t,e)},insert:function(t,e,r){return(new WOQLQuery).insert(t,e,r)},graph:function(t){return(new WOQLQuery).graph(t)},nuke:function(t){return(new WOQLQuery).nuke(t)},query:function(){return new WOQLQuery},json:function(t){return(new WOQLQuery).json(t)},lib:function(){return new WOQLLibrary},string:function(t){return(new WOQLQuery).string(t)},literal:function(t,e){return(new WOQLQuery).literal(t,e)},date:function(t){return(new WOQLQuery).literal(t,"xsd:date")},datetime:function(t){return(new WOQLQuery).literal(t,"xsd:dateTime")},boolean:function(t){return(new WOQLQuery).boolean(t)},iri:function(t){return(new WOQLQuery).iri(t)},vars:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.map((function(t){return new Var(t)}))},vars_unique:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.map((function(t){return new VarUnique(t)}))},vars_unique_reset_start:function(t){SetVarsUniqueCounter(null!=t?t:0)},doc:function(t){return new Doc(t)},client:function(t){return t&&(this._client=t),this._client},Vars:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return _construct(Vars,e)},VarsUnique:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return _construct(VarsUnique,e)},emerge:function(auto_eval){var unemerged=["emerge","true","eval"];function _emerge_str(t){return"function ".concat(t,"(...args){\n return WOQL.").concat(t,"(...args)\n }")}var funcs=[_emerge_str("Vars")];for(var k in this)"function"==typeof this[k]&&-1===unemerged.indexOf(k)&&funcs.push(_emerge_str(k));var str=funcs.join(";\n");return auto_eval&&eval(str),str},update_triple:function(t,e,r,n){return(new WOQLQuery).update_triple(t,e,r,n)},update_quad:function(t,e,r,n){return(new WOQLQuery).update_quad(t,e,r,n)},value:function(t,e,r){return(new WOQLQuery).value(t,e,r)},link:function(t,e,r){return(new WOQLQuery).link(t,e,r)},dot:function(t,e,r){return(new WOQLQuery).dot(t,e,r)},set_difference:function(t,e,r){return(new WOQLQuery).set_difference(t,e,r)},set_intersection:function(t,e,r){return(new WOQLQuery).set_intersection(t,e,r)},set_union:function(t,e,r){return(new WOQLQuery).set_union(t,e,r)},set_member:function(t,e){return(new WOQLQuery).set_member(t,e)},list_to_set:function(t,e){return(new WOQLQuery).list_to_set(t,e)}};module.exports=WOQL},266(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){b(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(){"use strict";var t=p(),e=t.m(s),r=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===r||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function o(t){var e,r;return function(n){e||(e={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(t,e){return r(n.a,i[t],e)},delegateYield:function(t,i,o){return e.resultName=i,r(n.d,a(t),o)},finish:function(t){return r(n.f,t)}},r=function(t,r,i){n.p=e.prev,n.n=e.next;try{return t(r,i)}finally{e.next=n.n}}),e.resultName&&(e[e.resultName]=n.v,e.resultName=void 0),e.sent=n.v,e.next=n.n;try{return t.call(this,e)}finally{n.p=e.prev,n.n=e.next}}}return(s=function(){return{wrap:function(e,r,n,i){return t.w(o(e),r,n,i&&i.reverse())},isGeneratorFunction:n,mark:t.m,awrap:function(t,e){return new d(t,e)},AsyncIterator:l,async:function(t,e,r,i,s){return(n(e)?h:c)(o(t),e,r,i,s)},keys:u,values:a}})()}function a(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(n(t)+" is not iterable")}function u(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}}function c(t,e,r,n,i){var o=h(t,e,r,n,i);return o.next().then((function(t){return t.done?t.value:o.next()}))}function h(t,e,r,n,i){return new l(p().w(t,e,r,n),i||Promise)}function l(t,e){function r(n,i,o,s){try{var a=t[n](i),u=a.value;return u instanceof d?e.resolve(u.v).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){a.value=t,o(a)}),(function(t){return r("throw",t,o,s)}))}catch(t){s(t)}}var n;this.next||(f(l.prototype),f(l.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),f(this,"_invoke",(function(t,i,o){function s(){return new e((function(e,n){r(t,o,e,n)}))}return n=n?n.then(s,s):s()}),!0)}function p(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof a?n:a,c=Object.create(u.prototype);return f(c,"_invoke",function(r,n,i){var o,a,u,c=0,h=i||[],l=!1,p={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return o=e,a=0,u=t,p.n=r,s}};function f(r,n){for(a=r,u=n,e=0;!l&&c&&!i&&e<h.length;e++){var i,o=h[e],f=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=f&&((i=r<2&&f<o[1])?(a=0,p.v=n,p.n=o[1]):f<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return s;throw l=!0,n}return function(i,h,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===h&&f(h,d),a=h,u=d;(e=a<2?t:u)||!l;){o||(a?a<3?(a>1&&(p.n=-1),f(a,u)):p.n=u:p.v=u);try{if(c=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(l=p.n<0)?u:r.call(n,p))!==s)break}catch(e){o=t,a=1,u=e}finally{c=1}}return{value:e,done:l}}}(r,i,o),!0),c}var s={};function a(){}function u(){}function c(){}e=Object.getPrototypeOf;var h=[][n]?e(e([][n]())):(f(e={},n,(function(){return this})),e),l=c.prototype=a.prototype=Object.create(h);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,f(t,i,"GeneratorFunction")),t.prototype=Object.create(l),t}return u.prototype=c,f(l,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(l),f(l,i,"Generator"),f(l,n,(function(){return this})),f(l,"toString",(function(){return"[object Generator]"})),(p=function(){return{w:o,m:d}})()}function f(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}f=function(t,e,r,n){function o(e,r){f(t,e,(function(t){return this._invoke(e,r,t)}))}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(o("next",0),o("throw",1),o("return",2))},f(t,e,r,n)}function d(t,e){this.v=t,this.k=e}function y(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function g(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){y(o,n,i,s,a,"next",t)}function a(t){y(o,n,i,s,a,"throw",t)}s(void 0)}))}}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w(n.key),n)}}function v(t,e,r){return e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function b(t,e,r){return(e=w(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var _=r(1894),O=r(6686),E=r(8287).Buffer,x=(r(7135),r(47)),j=r(3103),A=r(8139),S=r(9268),R=(r(7589),r(8111),v((function t(e,r){"use strict";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),b(this,"connectionConfig",null),b(this,"databaseList",[]),b(this,"organizationList",[]),this.connectionConfig=new S(e,r)})));function P(t,e){if(t instanceof Array)for(var r=0;r<t.length;r+=1)P(t[r],e);else for(var n=Object.keys(t),i=0;i<n.length;i+=1)"resource"===n[i]&&t[n[i]]["@type"]&&"QueryResource"===t[n[i]]["@type"]&&e.push(t[n[i]]),(t[n[i]]instanceof Object||t[n[i]]instanceof Array)&&P(t[n[i]],e)}R.prototype.setApiKey=function(t){var e=this.connectionConfig.localAuth()||{};e.key=t,e.type="apikey",this.connectionConfig.setLocalAuth(e)},R.prototype.customHeaders=function(t){if(!t)return this._customHeaders;this._customHeaders=t},R.prototype.CONST=x,R.prototype.copy=function(){var t=new R(this.server());return t.connectionConfig=this.connectionConfig.copy(),t.databaseList=this.databaseList,t},R.prototype.server=function(){return this.connectionConfig.serverURL()},R.prototype.api=function(){return this.connectionConfig.apiURL()},R.prototype.organization=function(t){return void 0!==t&&(this.connectionConfig.setOrganization(t),this.databases([])),this.connectionConfig.organization()},R.prototype.hasDatabase=function(){var t=g(s().mark((function t(e,r){var n,i=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(this.connectionConfig.apiURL(),"db/").concat(e,"/").concat(r),t.abrupt("return",new Promise((function(t,e){i.dispatch(x.HEAD,n).then((function(e){t(!0)})).catch((function(r){404===r.status?t(!1):e(r)}))})));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),R.prototype.getDatabases=g(s().mark((function t(){var e,r,n=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.connectionConfig.organization()){t.next=2;break}throw new Error("You need to set the organization name");case 2:return t.next=4,this.getUserOrganizations();case 4:return e=this.userOrganizations().find((function(t){return t.name===n.connectionConfig.organization()})),r=e&&e.databases?e.databases:[],this.databases(r),t.abrupt("return",r);case 8:case"end":return t.stop()}}),t,this)}))),R.prototype.databases=function(t){return t&&(this.databaseList=t),this.databaseList||[]},R.prototype.user=function(){return this.connectionConfig.user()},R.prototype.userOrganization=function(){return this.user()},R.prototype.databaseInfo=function(t){return this.databases().find((function(e){return e.name===t}))||{}},R.prototype.db=function(t){return void 0!==t&&this.connectionConfig.setDB(t),this.connectionConfig.dbid},R.prototype.setSystemDb=function(){this.db(this.connectionConfig.system_db)},R.prototype.repo=function(t){return void 0!==t&&this.connectionConfig.setRepo(t),this.connectionConfig.repo()},R.prototype.checkout=function(t){return void 0!==t&&this.connectionConfig.setBranch(t),this.connectionConfig.branch()},R.prototype.ref=function(t){return void 0!==t&&this.connectionConfig.setRef(t),this.connectionConfig.ref()},R.prototype.localAuth=function(t){return void 0!==t&&this.connectionConfig.setLocalAuth(t),this.connectionConfig.localAuth()},R.prototype.local_auth=R.prototype.localAuth,R.prototype.remoteAuth=function(t){return void 0!==t&&this.connectionConfig.setRemoteAuth(t),this.connectionConfig.remoteAuth()},R.prototype.remote_auth=R.prototype.remoteAuth,R.prototype.author=function(){return this.connectionConfig.user()},R.prototype.set=function(t){this.connectionConfig.update(t)},R.prototype.resource=function(t,e){var r="".concat(this.organization(),"/").concat(this.db(),"/");if("db"===t)return r;if("meta"===t)return"".concat(r,"_meta");if(r+="".concat(this.repo()),"repo"===t)return r;if("commits"===t)return"".concat(r,"/_commits");var n=e||("ref"===t?this.ref():this.checkout());return"branch"===t?"".concat(r,"/branch/").concat(n):"ref"===t?"".concat(r,"/commit/").concat(n):void 0},R.prototype.connect=function(t){return t&&this.connectionConfig.update(t),this.dispatch(x.GET,this.connectionConfig.apiURLInfo()).then((function(t){return t}))},R.prototype.createDatabase=function(t,e,r){if(r&&this.organization(r),t)return this.db(t),this.dispatch(x.POST,this.connectionConfig.dbURL(),e);var n="Create database parameter error - you must specify a valid database id - ".concat(t," is invalid");return Promise.reject(new Error(A.getInvalidParameterMessage(x.CREATE_DATABASE,n)))},R.prototype.updateDatabase=function(t){var e=t.id||this.db();if(this.organization(t.organization||this.organization()),e)return this.db(e),this.dispatch(x.PUT,this.connectionConfig.dbURL(),t);var r="Update database error - you must specify a valid database id - ".concat(e," is invalid");return Promise.reject(new Error(A.getInvalidParameterMessage(x.UPDATE_DATABASE,r)))},R.prototype.deleteDatabase=function(t,e,r){var n=e||this.organization();this.organization(n);var i=r?{force:!0}:null;if(t&&this.db(t))return this.dispatch(x.DELETE,this.connectionConfig.dbURL(),i);var o="Delete database parameter error - you must specify a valid database id - ".concat(t," is invalid");return Promise.reject(new Error(A.getInvalidParameterMessage(x.DELETE,o)))},R.prototype.getTriples=function(t){return t?this.dispatch(x.GET,this.connectionConfig.triplesURL(t)):Promise.reject(new Error(A.getInvalidParameterMessage(x.GET,"Get triples parameter error - you must specify a valid graph type (inference, instance, schema), and graph id")))},R.prototype.updateTriples=function(t,e,r){if(r&&e&&t){var n=this.generateCommitInfo(r);return n.turtle=e,this.dispatch(x.UPDATE_TRIPLES,this.connectionConfig.triplesURL(t),n)}return Promise.reject(new Error(A.getInvalidParameterMessage(x.UPDATE_TRIPLES,"Update triples parameter error - you must specify a valid graph id, graph type, turtle contents and commit message")))},R.prototype.insertTriples=function(t,e,r){if(r&&e&&t){var n=this.generateCommitInfo(r);return n.turtle=e,this.dispatch(x.INSERT_TRIPLES,this.connectionConfig.triplesURL(t),n)}return Promise.reject(new Error(A.getInvalidParameterMessage(x.INSERT_TRIPLES,"Update triples parameter error - you must specify a valid graph id, graph type, turtle contents and commit message")))},R.prototype.message=function(t,e){var r=this.api();return r+=e?this.api()+e:"message",this.dispatch(x.GET,r,t).then((function(t){return t}))},R.prototype.action=function(t,e){var r="".concat(this.api(),"action/").concat(t);return this.dispatch(x.ACTION,r,e).then((function(t){return t}))},R.prototype.info=function(){var t="".concat(this.api(),"info");return this.dispatch(x.GET,t).then((function(t){return t}))},R.prototype.query=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];r=r||!1,e=e||"Commit generated with javascript client without message";var a=(null!=s?s:[]).reduce((function(t,e){return o(o({},t),{},b({},e.filename.split("/").pop(),e.data))}),{});if(null!=t&&t.json&&(!t.containsUpdate()||e)){var u,c=t.containsUpdate()?this.generateCommitInfo(e):{};c.query=t.json();var h=[];if(P(c.query,h),h.length>0){var l=new _;h.forEach((function(t){var e="string"==typeof t.source.post?null==a?void 0:a[t.source.post.split("/").pop()]:void 0,r=t.source.post.split("/").pop();e?l.append("file",E.from(e),{filename:r,contentType:"application/csv"}):l.append("file",O.createReadStream(t.source.post)),t.source.post=r})),l.append("payload",E.from(JSON.stringify(c)),{filename:"body.json",contentType:"application/json"}),l.getHeaders?this.customHeaders(l.getHeaders()):this.customHeaders({"Content-Type":"multipart/form-data"}),u=l}else u=c;return r&&(c.all_witnesses=!0),"string"==typeof n&&""!==n&&this.customHeaders({"TerminusDB-Data-Version":n}),this.dispatch(x.WOQL_QUERY,this.connectionConfig.queryURL(),u,i)}var p="WOQL query parameter error";return t&&t.json&&t.containsUpdate()&&!e?p+=" - you must include a textual commit message to perform this update":p+=" - you must specify a valid WOQL Query",Promise.reject(new Error(A.getInvalidParameterMessage(x.WOQL_QUERY,p)))},R.prototype.branch=function(t,e){if(t){var r=this.ref()?{origin:"".concat(this.organization(),"/").concat(this.db(),"/").concat(this.repo(),"/commit/").concat(this.ref())}:{origin:"".concat(this.organization(),"/").concat(this.db(),"/").concat(this.repo(),"/branch/").concat(this.checkout())};return e&&!0===e&&(r={}),this.dispatch(x.BRANCH,this.connectionConfig.branchURL(t),r)}return Promise.reject(new Error(A.getInvalidParameterMessage(x.BRANCH,"Branch parameter error - you must specify a valid new branch id")))},R.prototype.squashBranch=function(t,e){if(e&&t){var r=this.generateCommitInfo(e);return this.dispatch(x.SQUASH_BRANCH,this.connectionConfig.squashBranchURL(t),r)}return Promise.reject(new Error(A.getInvalidParameterMessage(x.SQUASH_BRANCH,"Branch parameter error - you must specify a valid new branch id and a commit message")))},R.prototype.resetBranch=function(t,e){return e&&t?this.dispatch(x.RESET_BRANCH,this.connectionConfig.resetBranchUrl(t),{commit_descriptor:e}):Promise.reject(new Error(A.getInvalidParameterMessage(x.RESET_BRANCH,"Branch parameter error - you must specify a valid new branch id and a commit message")))},R.prototype.optimizeBranch=function(t){return t?this.dispatch(x.OPTIMIZE_SYSTEM,this.connectionConfig.optimizeBranchUrl(t),{}):Promise.reject(new Error(A.getInvalidParameterMessage(x.BRANCH,"Branch parameter error - you must specify a valid branch id")))},R.prototype.deleteBranch=function(t){return t?this.dispatch(x.DELETE,this.connectionConfig.branchURL(t)):Promise.reject(new Error(A.getInvalidParameterMessage(x.BRANCH,"Branch parameter error - you must specify a valid new branch id")))},R.prototype.pull=function(t){var e=this.prepareRevisionControlArgs(t);return e&&e.remote&&e.remote_branch?this.dispatch(x.PULL,this.connectionConfig.pullURL(),e):Promise.reject(new Error(A.getInvalidParameterMessage(x.PULL,"Pull parameter error - you must specify a valid remote source and branch to pull from")))},R.prototype.fetch=function(t){return this.dispatch(x.FETCH,this.connectionConfig.fetchURL(t))},R.prototype.push=function(t){var e=this.prepareRevisionControlArgs(t);return e&&e.remote&&e.remote_branch?this.dispatch(x.PUSH,this.connectionConfig.pushURL(),e):Promise.reject(new Error(A.getInvalidParameterMessage(x.PUSH,"Push parameter error - you must specify a valid remote target")))},R.prototype.rebase=function(t){var e=this.prepareRevisionControlArgs(t);return e&&e.rebase_from?this.dispatch(x.REBASE,this.connectionConfig.rebaseURL(),e):Promise.reject(new Error(A.getInvalidParameterMessage(x.REBASE,"Rebase parameter error - you must specify a valid rebase source to rebase from")))},R.prototype.reset=function(t){return this.dispatch(x.RESET,this.connectionConfig.resetURL(),{commit_descriptor:t})},R.prototype.createRemote=function(t,e){return t&&"string"==typeof t?e&&"string"==typeof e?this.dispatch(x.POST,this.connectionConfig.remoteURL(),{remote_name:t,remote_location:e}):Promise.reject(new Error(A.getInvalidParameterMessage(x.CREATE_REMOTE,"Create remote parameter error - you must specify a valid remote location URL"))):Promise.reject(new Error(A.getInvalidParameterMessage(x.CREATE_REMOTE,"Create remote parameter error - you must specify a valid remote name")))},R.prototype.getRemote=function(t){if(!t||"string"!=typeof t)return Promise.reject(new Error(A.getInvalidParameterMessage(x.GET_REMOTE,"Get remote parameter error - you must specify a valid remote name")));var e="".concat(this.connectionConfig.remoteURL(),"?remote_name=").concat(encodeURIComponent(t));return this.dispatch(x.GET,e)},R.prototype.updateRemote=function(t,e){return t&&"string"==typeof t?e&&"string"==typeof e?this.dispatch(x.PUT,this.connectionConfig.remoteURL(),{remote_name:t,remote_location:e}):Promise.reject(new Error(A.getInvalidParameterMessage(x.UPDATE_REMOTE,"Update remote parameter error - you must specify a valid remote location URL"))):Promise.reject(new Error(A.getInvalidParameterMessage(x.UPDATE_REMOTE,"Update remote parameter error - you must specify a valid remote name")))},R.prototype.deleteRemote=function(t){if(!t||"string"!=typeof t)return Promise.reject(new Error(A.getInvalidParameterMessage(x.DELETE_REMOTE,"Delete remote parameter error - you must specify a valid remote name")));var e="".concat(this.connectionConfig.remoteURL(),"?remote_name=").concat(encodeURIComponent(t));return this.dispatch(x.DELETE,e)},R.prototype.clonedb=function(t,e,r){r=r||this.user_organization(),this.organization(r);var n=this.prepareRevisionControlArgs(t);return e&&n&&n.remote_url?this.dispatch(x.CLONE,this.connectionConfig.cloneURL(e),n):Promise.reject(new Error(A.getInvalidParameterMessage(x.BRANCH,"Clone parameter error - you must specify a valid id for the cloned database")))},R.prototype.dispatch=function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return e?j(e,t,r,this.localAuth(),this.remoteAuth(),this.customHeaders(),n,i):Promise.reject(new Error(A.getInvalidParameterMessage(t,this.connectionConfig.connection_error)))},R.prototype.generateCommitInfo=function(t,e){return e||(e=this.author()),{commit_info:{author:e,message:t}}},R.prototype.generateCommitDescriptor=function(t){return{commit_descriptor:this.connectionConfig.commitDescriptorUrl(t)}},R.prototype.prepareRevisionControlArgs=function(t){return!(!t||"object"!==n(t))&&(t.author||(t.author=this.author()),t)},R.prototype.addDocument=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"add a new document",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];r&&this.db(r),"string"==typeof i&&""!==i&&this.customHeaders({"TerminusDB-Data-Version":i});var a=e||{};return a.author=this.author(),a.message=n,this.dispatch(x.POST,this.connectionConfig.documentURL(a),t,o,s)},R.prototype.queryDocument=function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return r&&this.db(r),n&&this.checkout(n),"string"==typeof i&&""!==i&&this.customHeaders({"TerminusDB-Data-Version":i}),this.dispatch(x.QUERY_DOCUMENT,this.connectionConfig.documentURL(e),t,o)},R.prototype.getDocument=function(t,e,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;return e&&this.db(e),r&&this.checkout(r),"string"==typeof o&&""!==o&&this.customHeaders({"TerminusDB-Data-Version":o}),a?i=a:t&&"object"===n(t)&&t.query&&(i={query:t.query},delete t.query),i?this.dispatch(x.QUERY_DOCUMENT,this.connectionConfig.documentURL(t),i,s):this.dispatch(x.GET,this.connectionConfig.documentURL(t),{},s)},R.prototype.updateDocument=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"update document",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=e||{};return u.author=this.author(),u.message=n,a&&(u.create=a),r&&this.db(r),"string"==typeof i&&""!==i&&this.customHeaders({"TerminusDB-Data-Version":i}),this.dispatch(x.PUT,this.connectionConfig.documentURL(u),t,o,s)},R.prototype.deleteDocument=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"delete document",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=t||{},s=null;return Array.isArray(t.id)&&(s=t.id,delete o.id),o.author=this.author(),o.message=r,e&&this.db(e),"string"==typeof n&&""!==n&&this.customHeaders({"TerminusDB-Data-Version":n}),this.dispatch(x.DELETE,this.connectionConfig.documentURL(o),s,i)},R.prototype.getSchemaFrame=function(t,e){var r;return t&&(r={type:t}),e&&this.db(e),this.dispatch(x.GET,this.connectionConfig.jsonSchemaURL(r))},R.prototype.getSchema=function(t,e){return this.getDocument({graph_type:"schema",as_list:!0},t,e)},R.prototype.getClasses=function(t){return this.getDocument({graph_type:"schema",as_list:!0,type:"sys:Class"},t)},R.prototype.getEnums=function(t){return this.getDocument({graph_type:"schema",as_list:!0,type:"sys:Enum"},t)},R.prototype.getClassDocuments=function(t){return this.getDocument({graph_type:"schema",as_list:!0,type:"sys:Class"},t).then((function(t){var e=[];return t&&(e=t.filter((function(t){return!t["@subdocument"]&&!t["@abstract"]}))),e}))},R.prototype.getBranches=function(t){var e=this,r=this.checkout();return this.getDocument({type:"Branch",as_list:!0},t,"_commits").then((function(t){var n={};return t&&t.forEach((function(t){n[t.name]=t})),e.checkout(r),n}))},R.prototype.getCommitsLog=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.dispatch(x.GET,"".concat(this.connectionConfig.log(),"?start=").concat(t,"&count=").concat(e))},R.prototype.getPrefixes=function(t){return t&&this.db(t),this.dispatch(x.GET,this.connectionConfig.prefixesURL())},R.prototype.getUserOrganizations=function(){var t=this;return this.dispatch(x.GET,this.connectionConfig.userOrganizationsURL()).then((function(e){var r=Array.isArray(e)?e:[];return t.userOrganizations(r),r}))},R.prototype.userOrganizations=function(t){return t&&(this.organizationList=t),this.organizationList||[]},R.prototype.patch=function(t,e){if("object"!==n(t)||"object"!==n(e))return Promise.reject(new Error(A.getInvalidParameterMessage(x.PATCH,'"before" or "after" parameter error - you must specify a valid before and after json document')));var r={before:t,patch:e};return this.dispatch(x.POST,"".concat(this.connectionConfig.apiURL(),"patch"),r).then((function(t){return t}))},R.prototype.patchResource=function(t,e){if(!Array.isArray(t))return Promise.reject(new Error(A.getInvalidParameterMessage(x.PATCH,'"patch" parameter error - you must specify a valid patch document')));var r={patch:t,author:this.author(),message:e};return this.dispatch(x.POST,this.connectionConfig.patchURL(),r).then((function(t){return t}))},R.prototype.getJSONDiff=function(t,e,r){if("object"!==n(t)||"object"!==n(e))return Promise.reject(new Error(A.getInvalidParameterMessage(x.GET_DIFF,'"before" or "after" parameter error - you must specify a valid before or after json document')));var i=o({before:t,after:e},void 0===r?{}:r);return this.dispatch(x.POST,"".concat(this.connectionConfig.apiURL(),"diff"),i).then((function(t){return t}))},R.prototype.getVersionObjectDiff=function(t,e,r,i){if("object"!==n(e)||"string"!=typeof t||"string"!=typeof r)return Promise.reject(new Error(A.getInvalidParameterMessage(x.GET_DIFF,"Parameters error - you must specify a valid jsonObject document, a valid branch or commit and a valid id")));var s=o({after:e,before_data_version:t,id:r},i||{});return this.dispatch(x.POST,this.connectionConfig.diffURL(),s).then((function(t){return t}))},R.prototype.getVersionDiff=function(t,e,r,n){if("string"!=typeof t||"string"!=typeof e)return Promise.reject(new Error(A.getInvalidParameterMessage(x.GET_DIFF,"Error, you have to provide a beforeVersion and afterVersion input")));var i=o({before_data_version:t,after_data_version:e},n||{});return r&&(i.document_id=r),this.dispatch(x.POST,this.connectionConfig.diffURL(),i).then((function(t){return t}))},R.prototype.apply=function(t,e,r,n,i){var s=i||{},a=o(o({before_commit:t,after_commit:e},this.generateCommitInfo(r)),s);return n&&(a.match_final_state=n),this.dispatch(x.POST,this.connectionConfig.applyURL(),a).then((function(t){return t}))},R.prototype.getDocumentHistory=function(t,e){var r=e||{};return r.id=t,void 0===r.count&&(r.count=10),this.dispatch(x.GET,this.connectionConfig.docHistoryURL(r)).then((function(t){return t}))},R.prototype.sendCustomRequest=function(t,e,r){return this.dispatch(t,e,r).then((function(t){return t}))},R.prototype.getPrefix=function(t,e){e&&this.db(e);var r="".concat(this.connectionConfig.prefixURL(),"/").concat(t);return this.dispatch(x.GET,r).then((function(t){return t["api:prefix_uri"]}))},R.prototype.addPrefix=function(t,e,r){r&&this.db(r);var n="".concat(this.connectionConfig.prefixURL(),"/").concat(t);return this.dispatch(x.POST,n,{uri:e})},R.prototype.updatePrefix=function(t,e,r){r&&this.db(r);var n="".concat(this.connectionConfig.prefixURL(),"/").concat(t);return this.dispatch(x.PUT,n,{uri:e})},R.prototype.upsertPrefix=function(t,e,r){r&&this.db(r);var n="".concat(this.connectionConfig.prefixURL(),"/").concat(t,"?create=true");return this.dispatch(x.PUT,n,{uri:e})},R.prototype.deletePrefix=function(t,e){e&&this.db(e);var r="".concat(this.connectionConfig.prefixURL(),"/").concat(t);return this.dispatch(x.DELETE,r)},t.exports=R},7526(t,e){"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],u=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),h=0,l=u>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[h++]=e>>16&255,c[h++]=e>>8&255,c[h++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[h++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(t,a,a+s>c?c:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287(t,e,r){"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return f(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?a(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return h(t),a(t<0?0:0|d(t))}function p(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function d(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:H(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if($(n))return s;t[r+s]=n}return s}function _(t,e,r,n){return Z(H(e,t.length-r),t,r,n)}function O(t,e,r,n){return Z(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return Z(G(e),t,r,n)}function x(t,e,r,n){return Z(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=S));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return l(t)},u.allocUnsafeSlow=function(t){return l(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(J(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r);for(let t=0;t<a;++t)if(c[t]!==h[t]){o=c[t],s=h[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return O(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function R(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function P(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=K[t[n]];return i}function T(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function L(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){Q(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function U(t,e,r,n,i){Q(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function I(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(t,e,r,n,o){return e=+e,r>>>=0,o||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return e=+e,r>>>=0,o||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Y((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Y((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Y((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Y((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Y((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Y((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Y((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Y((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return V(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return V(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const z={};function N(t,e,r){z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Q(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new z.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}N("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),N("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),N("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const M=/[^+/0-9A-Za-z-_]/g;function H(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?X:t}function X(){throw new Error("BigInt not supported")}},1894(t){"use strict";t.exports="object"==typeof self?self.FormData:window.FormData},251(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,l=r?i-1:0,p=r?-1:1,f=t[e+l];for(l+=p,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+l],l+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+l],l+=p,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+f]=255&s,f+=d,s/=256,c-=8);t[r+f-d]|=128*y}},1668(t,e,r){"use strict";const{Deflate:n,deflate:i,deflateRaw:o,gzip:s}=r(3303),{Inflate:a,inflate:u,inflateRaw:c,ungzip:h}=r(7083),l=r(9681);t.exports.Deflate=n,t.exports.deflate=i,t.exports.deflateRaw=o,t.exports.gzip=s,t.exports.Inflate=a,t.exports.inflate=u,t.exports.inflateRaw=c,t.exports.ungzip=h,t.exports.constants=l},3303(t,e,r){"use strict";const n=r(8411),i=r(9805),o=r(1996),s=r(4674),a=r(4442),u=Object.prototype.toString,{Z_NO_FLUSH:c,Z_SYNC_FLUSH:h,Z_FULL_FLUSH:l,Z_FINISH:p,Z_OK:f,Z_STREAM_END:d,Z_DEFAULT_COMPRESSION:y,Z_DEFAULT_STRATEGY:g,Z_DEFLATED:m}=r(9681);function v(t){this.options=i.assign({level:y,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:g},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;let r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==f)throw new Error(s[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=n.deflateSetDictionary(this.strm,t),r!==f)throw new Error(s[r]);this._dict_set=!0}}function b(t,e){const r=new v(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}v.prototype.push=function(t,e){const r=this.strm,i=this.options.chunkSize;let s,a;if(this.ended)return!1;for(a=e===~~e?e:!0===e?p:c,"string"==typeof t?r.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(a===h||a===l)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(s=n.deflate(r,a),s===d)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),s=n.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===f;if(0!==r.avail_out){if(a>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},v.prototype.onData=function(t){this.chunks.push(t)},v.prototype.onEnd=function(t){t===f&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},t.exports.Deflate=v,t.exports.deflate=b,t.exports.deflateRaw=function(t,e){return(e=e||{}).raw=!0,b(t,e)},t.exports.gzip=function(t,e){return(e=e||{}).gzip=!0,b(t,e)},t.exports.constants=r(9681)},7083(t,e,r){"use strict";const n=r(1447),i=r(9805),o=r(1996),s=r(4674),a=r(4442),u=r(7414),c=Object.prototype.toString,{Z_NO_FLUSH:h,Z_FINISH:l,Z_OK:p,Z_STREAM_END:f,Z_NEED_DICT:d,Z_STREAM_ERROR:y,Z_DATA_ERROR:g,Z_MEM_ERROR:m}=r(9681);function v(t){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;let r=n.inflateInit2(this.strm,e.windowBits);if(r!==p)throw new Error(s[r]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary),r!==p)))throw new Error(s[r])}function b(t,e){const r=new v(e);if(r.push(t),r.err)throw r.msg||s[r.err];return r.result}v.prototype.push=function(t,e){const r=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,u,v;if(this.ended)return!1;for(u=e===~~e?e:!0===e?l:h,"[object ArrayBuffer]"===c.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),a=n.inflate(r,u),a===d&&s&&(a=n.inflateSetDictionary(r,s),a===p?a=n.inflate(r,u):a===g&&(a=d));r.avail_in>0&&a===f&&r.state.wrap>0&&0!==t[r.next_in];)n.inflateReset(r),a=n.inflate(r,u);switch(a){case y:case g:case d:case m:return this.onEnd(a),this.ended=!0,!1}if(v=r.avail_out,r.next_out&&(0===r.avail_out||a===f))if("string"===this.options.to){let t=o.utf8border(r.output,r.next_out),e=r.next_out-t,n=o.buf2string(r.output,t);r.next_out=e,r.avail_out=i-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(n)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==p||0!==v){if(a===f)return a=n.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},v.prototype.onData=function(t){this.chunks.push(t)},v.prototype.onEnd=function(t){t===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},t.exports.Inflate=v,t.exports.inflate=b,t.exports.inflateRaw=function(t,e){return(e=e||{}).raw=!0,b(t,e)},t.exports.ungzip=b,t.exports.constants=r(9681)},9805(t){"use strict";const e=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);t.exports.assign=function(t){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const n=r.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const r in n)e(n,r)&&(t[r]=n[r])}}return t},t.exports.flattenChunks=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,i=t.length;e<i;e++){let i=t[e];r.set(i,n),n+=i.length}return r}},1996(t){"use strict";let e=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){e=!1}const r=new Uint8Array(256);for(let t=0;t<256;t++)r[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;r[254]=r[254]=1,t.exports.string2buf=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},t.exports.buf2string=(t,n)=>{const i=n||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,n));let o,s;const a=new Array(2*i);for(s=0,o=0;o<i;){let e=t[o++];if(e<128){a[s++]=e;continue}let n=r[e];if(n>4)a[s++]=65533,o+=n-1;else{for(e&=2===n?31:3===n?15:7;n>1&&o<i;)e=e<<6|63&t[o++],n--;n>1?a[s++]=65533:e<65536?a[s++]=e:(e-=65536,a[s++]=55296|e>>10&1023,a[s++]=56320|1023&e)}}return((t,r)=>{if(r<65534&&t.subarray&&e)return String.fromCharCode.apply(null,t.length===r?t:t.subarray(0,r));let n="";for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return n})(a,s)},t.exports.utf8border=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+r[t[n]]>e?n:e}},3269(t){"use strict";t.exports=(t,e,r,n)=>{let i=65535&t,o=t>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+e[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16}},9681(t){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823(t){"use strict";const e=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());t.exports=(t,r,n,i)=>{const o=e,s=i+n;t^=-1;for(let e=i;e<s;e++)t=t>>>8^o[255&(t^r[e])];return~t}},8411(t,e,r){"use strict";const{_tr_init:n,_tr_stored_block:i,_tr_flush_block:o,_tr_tally:s,_tr_align:a}=r(3665),u=r(3269),c=r(4823),h=r(4674),{Z_NO_FLUSH:l,Z_PARTIAL_FLUSH:p,Z_FULL_FLUSH:f,Z_FINISH:d,Z_BLOCK:y,Z_OK:g,Z_STREAM_END:m,Z_STREAM_ERROR:v,Z_DATA_ERROR:b,Z_BUF_ERROR:w,Z_DEFAULT_COMPRESSION:_,Z_FILTERED:O,Z_HUFFMAN_ONLY:E,Z_RLE:x,Z_FIXED:j,Z_DEFAULT_STRATEGY:A,Z_UNKNOWN:S,Z_DEFLATED:R}=r(9681),P=258,C=262,T=103,L=113,k=666,D=(t,e)=>(t.msg=h[e],e),U=t=>(t<<1)-(t>4?9:0),I=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let V=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const B=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},z=(t,e)=>{o(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,B(t.strm)},N=(t,e)=>{t.pending_buf[t.pending++]=e},F=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Q=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=u(t.adler,e,i,r):2===t.state.wrap&&(t.adler=c(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},W=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match;const u=t.strstart>t.w_size-C?t.strstart-(t.w_size-C):0,c=t.window,h=t.w_mask,l=t.prev,p=t.strstart+P;let f=c[o+s-1],d=c[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(r=e,c[r+s]===d&&c[r+s-1]===f&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<p);if(n=P-(p-o),o=p-P,n>s){if(t.match_start=e,s=n,n>=a)break;f=c[o+s-1],d=c[o+s]}}}while((e=l[e&h])>u&&0!=--i);return s<=t.lookahead?s:t.lookahead},q=t=>{const e=t.w_size;let r,n,i,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-C)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do{i=t.head[--r],t.head[r]=i>=e?i-e:0}while(--n);n=e,r=n;do{i=t.prev[--r],t.prev[r]=i>=e?i-e:0}while(--n);o+=e}if(0===t.strm.avail_in)break;if(n=Q(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=n,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=V(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=V(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<C&&0!==t.strm.avail_in)},M=(t,e)=>{let r,n;for(;;){if(t.lookahead<C){if(q(t),t.lookahead<C&&e===l)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=V(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-C&&(t.match_length=W(t,r)),t.match_length>=3)if(n=s(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=V(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=V(t,t.ins_h,t.window[t.strstart+1]);else n=s(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(z(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===d?(z(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(z(t,!1),0===t.strm.avail_out)?1:2},H=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<C){if(q(t),t.lookahead<C&&e===l)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=V(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-C&&(t.match_length=W(t,r),t.match_length<=5&&(t.strategy===O||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=s(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=V(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(z(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=s(t,0,t.window[t.strstart-1]),n&&z(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=s(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===d?(z(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(z(t,!1),0===t.strm.avail_out)?1:2};function G(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Z=[new G(0,0,0,0,((t,e)=>{let r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(q(t),0===t.lookahead&&e===l)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,z(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-C&&(z(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===d?(z(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(z(t,!1),t.strm.avail_out),1)})),new G(4,4,8,4,M),new G(4,5,16,8,M),new G(4,6,32,32,M),new G(4,4,16,16,H),new G(8,16,32,32,H),new G(8,16,128,128,H),new G(8,32,128,256,H),new G(32,128,258,1024,H),new G(32,258,258,4096,H)];function J(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=R,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),I(this.dyn_ltree),I(this.dyn_dtree),I(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),I(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),I(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const $=t=>{if(!t||!t.state)return D(t,v);t.total_in=t.total_out=0,t.data_type=S;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:L,t.adler=2===e.wrap?0:1,e.last_flush=l,n(e),g},K=t=>{const e=$(t);var r;return e===g&&((r=t.state).window_size=2*r.w_size,I(r.head),r.max_lazy_match=Z[r.level].max_lazy,r.good_match=Z[r.level].good_length,r.nice_match=Z[r.level].nice_length,r.max_chain_length=Z[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},Y=(t,e,r,n,i,o)=>{if(!t)return v;let s=1;if(e===_&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==R||n<8||n>15||e<0||e>9||o<0||o>j)return D(t,v);8===n&&(n=9);const a=new J;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=3*a.lit_bufsize,a.level=e,a.strategy=o,a.method=r,K(t)};t.exports.deflateInit=(t,e)=>Y(t,e,R,15,8,A),t.exports.deflateInit2=Y,t.exports.deflateReset=K,t.exports.deflateResetKeep=$,t.exports.deflateSetHeader=(t,e)=>t&&t.state?2!==t.state.wrap?v:(t.state.gzhead=e,g):v,t.exports.deflate=(t,e)=>{let r,n;if(!t||!t.state||e>y||e<0)return t?D(t,v):v;const o=t.state;if(!t.output||!t.input&&0!==t.avail_in||o.status===k&&e!==d)return D(t,0===t.avail_out?w:v);o.strm=t;const u=o.last_flush;if(o.last_flush=e,42===o.status)if(2===o.wrap)t.adler=0,N(o,31),N(o,139),N(o,8),o.gzhead?(N(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),N(o,255&o.gzhead.time),N(o,o.gzhead.time>>8&255),N(o,o.gzhead.time>>16&255),N(o,o.gzhead.time>>24&255),N(o,9===o.level?2:o.strategy>=E||o.level<2?4:0),N(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(N(o,255&o.gzhead.extra.length),N(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=c(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=69):(N(o,0),N(o,0),N(o,0),N(o,0),N(o,0),N(o,9===o.level?2:o.strategy>=E||o.level<2?4:0),N(o,3),o.status=L);else{let e=R+(o.w_bits-8<<4)<<8,r=-1;r=o.strategy>=E||o.level<2?0:o.level<6?1:6===o.level?2:3,e|=r<<6,0!==o.strstart&&(e|=32),e+=31-e%31,o.status=L,F(o,e),0!==o.strstart&&(F(o,t.adler>>>16),F(o,65535&t.adler)),t.adler=1}if(69===o.status)if(o.gzhead.extra){for(r=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>r&&(t.adler=c(t.adler,o.pending_buf,o.pending-r,r)),B(t),r=o.pending,o.pending!==o.pending_buf_size));)N(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>r&&(t.adler=c(t.adler,o.pending_buf,o.pending-r,r)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=73)}else o.status=73;if(73===o.status)if(o.gzhead.name){r=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>r&&(t.adler=c(t.adler,o.pending_buf,o.pending-r,r)),B(t),r=o.pending,o.pending===o.pending_buf_size)){n=1;break}n=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,N(o,n)}while(0!==n);o.gzhead.hcrc&&o.pending>r&&(t.adler=c(t.adler,o.pending_buf,o.pending-r,r)),0===n&&(o.gzindex=0,o.status=91)}else o.status=91;if(91===o.status)if(o.gzhead.comment){r=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>r&&(t.adler=c(t.adler,o.pending_buf,o.pending-r,r)),B(t),r=o.pending,o.pending===o.pending_buf_size)){n=1;break}n=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,N(o,n)}while(0!==n);o.gzhead.hcrc&&o.pending>r&&(t.adler=c(t.adler,o.pending_buf,o.pending-r,r)),0===n&&(o.status=T)}else o.status=T;if(o.status===T&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&B(t),o.pending+2<=o.pending_buf_size&&(N(o,255&t.adler),N(o,t.adler>>8&255),t.adler=0,o.status=L)):o.status=L),0!==o.pending){if(B(t),0===t.avail_out)return o.last_flush=-1,g}else if(0===t.avail_in&&U(e)<=U(u)&&e!==d)return D(t,w);if(o.status===k&&0!==t.avail_in)return D(t,w);if(0!==t.avail_in||0!==o.lookahead||e!==l&&o.status!==k){let r=o.strategy===E?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(q(t),0===t.lookahead)){if(e===l)return 1;break}if(t.match_length=0,r=s(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(z(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===d?(z(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(z(t,!1),0===t.strm.avail_out)?1:2})(o,e):o.strategy===x?((t,e)=>{let r,n,i,o;const a=t.window;for(;;){if(t.lookahead<=P){if(q(t),t.lookahead<=P&&e===l)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=t.strstart+P;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);t.match_length=P-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(z(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===d?(z(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(z(t,!1),0===t.strm.avail_out)?1:2})(o,e):Z[o.level].func(o,e);if(3!==r&&4!==r||(o.status=k),1===r||3===r)return 0===t.avail_out&&(o.last_flush=-1),g;if(2===r&&(e===p?a(o):e!==y&&(i(o,0,0,!1),e===f&&(I(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),B(t),0===t.avail_out))return o.last_flush=-1,g}return e!==d?g:o.wrap<=0?m:(2===o.wrap?(N(o,255&t.adler),N(o,t.adler>>8&255),N(o,t.adler>>16&255),N(o,t.adler>>24&255),N(o,255&t.total_in),N(o,t.total_in>>8&255),N(o,t.total_in>>16&255),N(o,t.total_in>>24&255)):(F(o,t.adler>>>16),F(o,65535&t.adler)),B(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?g:m)},t.exports.deflateEnd=t=>{if(!t||!t.state)return v;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==T&&e!==L&&e!==k?D(t,v):(t.state=null,e===L?D(t,b):g)},t.exports.deflateSetDictionary=(t,e)=>{let r=e.length;if(!t||!t.state)return v;const n=t.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return v;if(1===i&&(t.adler=u(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(I(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,q(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=V(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,q(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,n.wrap=i,g},t.exports.deflateInfo="pako deflate (from Nodeca project)"},7414(t){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293(t){"use strict";t.exports=function(t,e){let r,n,i,o,s,a,u,c,h,l,p,f,d,y,g,m,v,b,w,_,O,E,x,j;const A=t.state;r=t.next_in,x=t.input,n=r+(t.avail_in-5),i=t.next_out,j=t.output,o=i-(e-t.avail_out),s=i+(t.avail_out-257),a=A.dmax,u=A.wsize,c=A.whave,h=A.wnext,l=A.window,p=A.hold,f=A.bits,d=A.lencode,y=A.distcode,g=(1<<A.lenbits)-1,m=(1<<A.distbits)-1;t:do{f<15&&(p+=x[r++]<<f,f+=8,p+=x[r++]<<f,f+=8),v=d[p&g];e:for(;;){if(b=v>>>24,p>>>=b,f-=b,b=v>>>16&255,0===b)j[i++]=65535&v;else{if(!(16&b)){if(64&b){if(32&b){A.mode=12;break t}t.msg="invalid literal/length code",A.mode=30;break t}v=d[(65535&v)+(p&(1<<b)-1)];continue e}for(w=65535&v,b&=15,b&&(f<b&&(p+=x[r++]<<f,f+=8),w+=p&(1<<b)-1,p>>>=b,f-=b),f<15&&(p+=x[r++]<<f,f+=8,p+=x[r++]<<f,f+=8),v=y[p&m];;){if(b=v>>>24,p>>>=b,f-=b,b=v>>>16&255,16&b){if(_=65535&v,b&=15,f<b&&(p+=x[r++]<<f,f+=8,f<b&&(p+=x[r++]<<f,f+=8)),_+=p&(1<<b)-1,_>a){t.msg="invalid distance too far back",A.mode=30;break t}if(p>>>=b,f-=b,b=i-o,_>b){if(b=_-b,b>c&&A.sane){t.msg="invalid distance too far back",A.mode=30;break t}if(O=0,E=l,0===h){if(O+=u-b,b<w){w-=b;do{j[i++]=l[O++]}while(--b);O=i-_,E=j}}else if(h<b){if(O+=u+h-b,b-=h,b<w){w-=b;do{j[i++]=l[O++]}while(--b);if(O=0,h<w){b=h,w-=b;do{j[i++]=l[O++]}while(--b);O=i-_,E=j}}}else if(O+=h-b,b<w){w-=b;do{j[i++]=l[O++]}while(--b);O=i-_,E=j}for(;w>2;)j[i++]=E[O++],j[i++]=E[O++],j[i++]=E[O++],w-=3;w&&(j[i++]=E[O++],w>1&&(j[i++]=E[O++]))}else{O=i-_;do{j[i++]=j[O++],j[i++]=j[O++],j[i++]=j[O++],w-=3}while(w>2);w&&(j[i++]=j[O++],w>1&&(j[i++]=j[O++]))}break}if(64&b){t.msg="invalid distance code",A.mode=30;break t}v=y[(65535&v)+(p&(1<<b)-1)]}}break}}while(r<n&&i<s);w=f>>3,r-=w,f-=w<<3,p&=(1<<f)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<s?s-i+257:257-(i-s),A.hold=p,A.bits=f}},1447(t,e,r){"use strict";const n=r(3269),i=r(4823),o=r(7293),s=r(1998),{Z_FINISH:a,Z_BLOCK:u,Z_TREES:c,Z_OK:h,Z_STREAM_END:l,Z_NEED_DICT:p,Z_STREAM_ERROR:f,Z_DATA_ERROR:d,Z_MEM_ERROR:y,Z_BUF_ERROR:g,Z_DEFLATED:m}=r(9681),v=12,b=30,w=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const O=t=>{if(!t||!t.state)return f;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,h},E=t=>{if(!t||!t.state)return f;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,O(t)},x=(t,e)=>{let r;if(!t||!t.state)return f;const n=t.state;return e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?f:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,E(t))},j=(t,e)=>{if(!t)return f;const r=new _;t.state=r,r.window=null;const n=x(t,e);return n!==h&&(t.state=null),n};let A,S,R=!0;const P=t=>{if(R){A=new Int32Array(512),S=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,A,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,S,0,t.work,{bits:5}),R=!1}t.lencode=A,t.lenbits=9,t.distcode=S,t.distbits=5},C=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};t.exports.inflateReset=E,t.exports.inflateReset2=x,t.exports.inflateResetKeep=O,t.exports.inflateInit=t=>j(t,15),t.exports.inflateInit2=j,t.exports.inflate=(t,e)=>{let r,_,O,E,x,j,A,S,R,T,L,k,D,U,I,V,B,z,N,F,Q,W,q=0;const M=new Uint8Array(4);let H,G;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return f;r=t.state,r.mode===v&&(r.mode=13),x=t.next_out,O=t.output,A=t.avail_out,E=t.next_in,_=t.input,j=t.avail_in,S=r.hold,R=r.bits,T=j,L=A,W=h;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;R<16;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(2&r.wrap&&35615===S){r.check=0,M[0]=255&S,M[1]=S>>>8&255,r.check=i(r.check,M,2,0),S=0,R=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&S)<<8)+(S>>8))%31){t.msg="incorrect header check",r.mode=b;break}if((15&S)!==m){t.msg="unknown compression method",r.mode=b;break}if(S>>>=4,R-=4,Q=8+(15&S),0===r.wbits)r.wbits=Q;else if(Q>r.wbits){t.msg="invalid window size",r.mode=b;break}r.dmax=1<<r.wbits,t.adler=r.check=1,r.mode=512&S?10:v,S=0,R=0;break;case 2:for(;R<16;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(r.flags=S,(255&r.flags)!==m){t.msg="unknown compression method",r.mode=b;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=b;break}r.head&&(r.head.text=S>>8&1),512&r.flags&&(M[0]=255&S,M[1]=S>>>8&255,r.check=i(r.check,M,2,0)),S=0,R=0,r.mode=3;case 3:for(;R<32;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}r.head&&(r.head.time=S),512&r.flags&&(M[0]=255&S,M[1]=S>>>8&255,M[2]=S>>>16&255,M[3]=S>>>24&255,r.check=i(r.check,M,4,0)),S=0,R=0,r.mode=4;case 4:for(;R<16;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}r.head&&(r.head.xflags=255&S,r.head.os=S>>8),512&r.flags&&(M[0]=255&S,M[1]=S>>>8&255,r.check=i(r.check,M,2,0)),S=0,R=0,r.mode=5;case 5:if(1024&r.flags){for(;R<16;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}r.length=S,r.head&&(r.head.extra_len=S),512&r.flags&&(M[0]=255&S,M[1]=S>>>8&255,r.check=i(r.check,M,2,0)),S=0,R=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(k=r.length,k>j&&(k=j),k&&(r.head&&(Q=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(_.subarray(E,E+k),Q)),512&r.flags&&(r.check=i(r.check,_,k,E)),j-=k,E+=k,r.length-=k),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===j)break t;k=0;do{Q=_[E+k++],r.head&&Q&&r.length<65536&&(r.head.name+=String.fromCharCode(Q))}while(Q&&k<j);if(512&r.flags&&(r.check=i(r.check,_,k,E)),j-=k,E+=k,Q)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===j)break t;k=0;do{Q=_[E+k++],r.head&&Q&&r.length<65536&&(r.head.comment+=String.fromCharCode(Q))}while(Q&&k<j);if(512&r.flags&&(r.check=i(r.check,_,k,E)),j-=k,E+=k,Q)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;R<16;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(S!==(65535&r.check)){t.msg="header crc mismatch",r.mode=b;break}S=0,R=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=v;break;case 10:for(;R<32;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}t.adler=r.check=w(S),S=0,R=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=x,t.avail_out=A,t.next_in=E,t.avail_in=j,r.hold=S,r.bits=R,p;t.adler=r.check=1,r.mode=v;case v:if(e===u||e===c)break t;case 13:if(r.last){S>>>=7&R,R-=7&R,r.mode=27;break}for(;R<3;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}switch(r.last=1&S,S>>>=1,R-=1,3&S){case 0:r.mode=14;break;case 1:if(P(r),r.mode=20,e===c){S>>>=2,R-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=b}S>>>=2,R-=2;break;case 14:for(S>>>=7&R,R-=7&R;R<32;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if((65535&S)!=(S>>>16^65535)){t.msg="invalid stored block lengths",r.mode=b;break}if(r.length=65535&S,S=0,R=0,r.mode=15,e===c)break t;case 15:r.mode=16;case 16:if(k=r.length,k){if(k>j&&(k=j),k>A&&(k=A),0===k)break t;O.set(_.subarray(E,E+k),x),j-=k,E+=k,A-=k,x+=k,r.length-=k;break}r.mode=v;break;case 17:for(;R<14;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(r.nlen=257+(31&S),S>>>=5,R-=5,r.ndist=1+(31&S),S>>>=5,R-=5,r.ncode=4+(15&S),S>>>=4,R-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=b;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;R<3;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}r.lens[Z[r.have++]]=7&S,S>>>=3,R-=3}for(;r.have<19;)r.lens[Z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,H={bits:r.lenbits},W=s(0,r.lens,0,19,r.lencode,0,r.work,H),r.lenbits=H.bits,W){t.msg="invalid code lengths set",r.mode=b;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;q=r.lencode[S&(1<<r.lenbits)-1],I=q>>>24,V=q>>>16&255,B=65535&q,!(I<=R);){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(B<16)S>>>=I,R-=I,r.lens[r.have++]=B;else{if(16===B){for(G=I+2;R<G;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(S>>>=I,R-=I,0===r.have){t.msg="invalid bit length repeat",r.mode=b;break}Q=r.lens[r.have-1],k=3+(3&S),S>>>=2,R-=2}else if(17===B){for(G=I+3;R<G;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}S>>>=I,R-=I,Q=0,k=3+(7&S),S>>>=3,R-=3}else{for(G=I+7;R<G;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}S>>>=I,R-=I,Q=0,k=11+(127&S),S>>>=7,R-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=b;break}for(;k--;)r.lens[r.have++]=Q}}if(r.mode===b)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=b;break}if(r.lenbits=9,H={bits:r.lenbits},W=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,H),r.lenbits=H.bits,W){t.msg="invalid literal/lengths set",r.mode=b;break}if(r.distbits=6,r.distcode=r.distdyn,H={bits:r.distbits},W=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,H),r.distbits=H.bits,W){t.msg="invalid distances set",r.mode=b;break}if(r.mode=20,e===c)break t;case 20:r.mode=21;case 21:if(j>=6&&A>=258){t.next_out=x,t.avail_out=A,t.next_in=E,t.avail_in=j,r.hold=S,r.bits=R,o(t,L),x=t.next_out,O=t.output,A=t.avail_out,E=t.next_in,_=t.input,j=t.avail_in,S=r.hold,R=r.bits,r.mode===v&&(r.back=-1);break}for(r.back=0;q=r.lencode[S&(1<<r.lenbits)-1],I=q>>>24,V=q>>>16&255,B=65535&q,!(I<=R);){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(V&&!(240&V)){for(z=I,N=V,F=B;q=r.lencode[F+((S&(1<<z+N)-1)>>z)],I=q>>>24,V=q>>>16&255,B=65535&q,!(z+I<=R);){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}S>>>=z,R-=z,r.back+=z}if(S>>>=I,R-=I,r.back+=I,r.length=B,0===V){r.mode=26;break}if(32&V){r.back=-1,r.mode=v;break}if(64&V){t.msg="invalid literal/length code",r.mode=b;break}r.extra=15&V,r.mode=22;case 22:if(r.extra){for(G=r.extra;R<G;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}r.length+=S&(1<<r.extra)-1,S>>>=r.extra,R-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;q=r.distcode[S&(1<<r.distbits)-1],I=q>>>24,V=q>>>16&255,B=65535&q,!(I<=R);){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(!(240&V)){for(z=I,N=V,F=B;q=r.distcode[F+((S&(1<<z+N)-1)>>z)],I=q>>>24,V=q>>>16&255,B=65535&q,!(z+I<=R);){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}S>>>=z,R-=z,r.back+=z}if(S>>>=I,R-=I,r.back+=I,64&V){t.msg="invalid distance code",r.mode=b;break}r.offset=B,r.extra=15&V,r.mode=24;case 24:if(r.extra){for(G=r.extra;R<G;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}r.offset+=S&(1<<r.extra)-1,S>>>=r.extra,R-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=b;break}r.mode=25;case 25:if(0===A)break t;if(k=L-A,r.offset>k){if(k=r.offset-k,k>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=b;break}k>r.wnext?(k-=r.wnext,D=r.wsize-k):D=r.wnext-k,k>r.length&&(k=r.length),U=r.window}else U=O,D=x-r.offset,k=r.length;k>A&&(k=A),A-=k,r.length-=k;do{O[x++]=U[D++]}while(--k);0===r.length&&(r.mode=21);break;case 26:if(0===A)break t;O[x++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;R<32;){if(0===j)break t;j--,S|=_[E++]<<R,R+=8}if(L-=A,t.total_out+=L,r.total+=L,L&&(t.adler=r.check=r.flags?i(r.check,O,L,x-L):n(r.check,O,L,x-L)),L=A,(r.flags?S:w(S))!==r.check){t.msg="incorrect data check",r.mode=b;break}S=0,R=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;R<32;){if(0===j)break t;j--,S+=_[E++]<<R,R+=8}if(S!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=b;break}S=0,R=0}r.mode=29;case 29:W=l;break t;case b:W=d;break t;case 31:return y;default:return f}return t.next_out=x,t.avail_out=A,t.next_in=E,t.avail_in=j,r.hold=S,r.bits=R,(r.wsize||L!==t.avail_out&&r.mode<b&&(r.mode<27||e!==a))&&C(t,t.output,t.next_out,L-t.avail_out)?(r.mode=31,y):(T-=t.avail_in,L-=t.avail_out,t.total_in+=T,t.total_out+=L,r.total+=L,r.wrap&&L&&(t.adler=r.check=r.flags?i(r.check,O,L,t.next_out-L):n(r.check,O,L,t.next_out-L)),t.data_type=r.bits+(r.last?64:0)+(r.mode===v?128:0)+(20===r.mode||15===r.mode?256:0),(0===T&&0===L||e===a)&&W===h&&(W=g),W)},t.exports.inflateEnd=t=>{if(!t||!t.state)return f;let e=t.state;return e.window&&(e.window=null),t.state=null,h},t.exports.inflateGetHeader=(t,e)=>{if(!t||!t.state)return f;const r=t.state;return 2&r.wrap?(r.head=e,e.done=!1,h):f},t.exports.inflateSetDictionary=(t,e)=>{const r=e.length;let i,o,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?f:11===i.mode&&(o=1,o=n(o,e,r,0),o!==i.check)?d:(s=C(t,e,r,r),s?(i.mode=31,y):(i.havedict=1,h))):f},t.exports.inflateInfo="pako inflate (from Nodeca project)"},1998(t){"use strict";const e=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),n=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),i=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);t.exports=(t,o,s,a,u,c,h,l)=>{const p=l.bits;let f,d,y,g,m,v,b=0,w=0,_=0,O=0,E=0,x=0,j=0,A=0,S=0,R=0,P=null,C=0;const T=new Uint16Array(16),L=new Uint16Array(16);let k,D,U,I=null,V=0;for(b=0;b<=15;b++)T[b]=0;for(w=0;w<a;w++)T[o[s+w]]++;for(E=p,O=15;O>=1&&0===T[O];O--);if(E>O&&(E=O),0===O)return u[c++]=20971520,u[c++]=20971520,l.bits=1,0;for(_=1;_<O&&0===T[_];_++);for(E<_&&(E=_),A=1,b=1;b<=15;b++)if(A<<=1,A-=T[b],A<0)return-1;if(A>0&&(0===t||1!==O))return-1;for(L[1]=0,b=1;b<15;b++)L[b+1]=L[b]+T[b];for(w=0;w<a;w++)0!==o[s+w]&&(h[L[o[s+w]]++]=w);if(0===t?(P=I=h,v=19):1===t?(P=e,C-=257,I=r,V-=257,v=256):(P=n,I=i,v=-1),R=0,w=0,b=_,m=c,x=E,j=0,y=-1,S=1<<E,g=S-1,1===t&&S>852||2===t&&S>592)return 1;for(;;){k=b-j,h[w]<v?(D=0,U=h[w]):h[w]>v?(D=I[V+h[w]],U=P[C+h[w]]):(D=96,U=0),f=1<<b-j,d=1<<x,_=d;do{d-=f,u[m+(R>>j)+d]=k<<24|D<<16|U}while(0!==d);for(f=1<<b-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,w++,0==--T[b]){if(b===O)break;b=o[s+h[w]]}if(b>E&&(R&g)!==y){for(0===j&&(j=E),m+=_,x=b-j,A=1<<x;x+j<O&&(A-=T[x+j],!(A<=0));)x++,A<<=1;if(S+=1<<x,1===t&&S>852||2===t&&S>592)return 1;y=R&g,u[y]=E<<24|x<<16|m-c}}return 0!==R&&(u[m+R]=b-j<<24|64<<16),l.bits=E,0}},4674(t){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);e(s);const a=new Array(60);e(a);const u=new Array(512);e(u);const c=new Array(256);e(c);const h=new Array(29);e(h);const l=new Array(30);function p(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let f,d,y;function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(l);const m=t=>t<256?u[t]:u[256+(t>>>7)],v=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},b=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,v(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},w=(t,e,r)=>{b(t,r[2*e],r[2*e+1])},_=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},O=(t,e,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)n[i]=s=s+r[i-1]<<1;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=_(n[e]++,e))}},E=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=t=>{t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},j=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},A=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&j(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!j(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},S=(t,e,i)=>{let o,s,a,u,p=0;if(0!==t.last_lit)do{o=t.pending_buf[t.d_buf+2*p]<<8|t.pending_buf[t.d_buf+2*p+1],s=t.pending_buf[t.l_buf+p],p++,0===o?w(t,s,e):(a=c[s],w(t,a+256+1,e),u=r[a],0!==u&&(s-=h[a],b(t,s,u)),o--,a=m(o),w(t,a,i),u=n[a],0!==u&&(o-=l[a],b(t,o,u)))}while(p<t.last_lit);w(t,256,e)},R=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let s,a,u,c=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(t.heap[++t.heap_len]=c=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=c<2?++c:0,r[2*u]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=n[2*u+1]);for(e.max_code=c,s=t.heap_len>>1;s>=1;s--)A(t,r,s);u=o;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[2*u]=r[2*s]+r[2*a],t.depth[u]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[2*s+1]=r[2*a+1]=u,t.heap[1]=u++,A(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,u=e.stat_desc.max_length;let c,h,l,p,f,d,y=0;for(p=0;p<=15;p++)t.bl_count[p]=0;for(r[2*t.heap[t.heap_max]+1]=0,c=t.heap_max+1;c<573;c++)h=t.heap[c],p=r[2*r[2*h+1]+1]+1,p>u&&(p=u,y++),r[2*h+1]=p,h>n||(t.bl_count[p]++,f=0,h>=a&&(f=s[h-a]),d=r[2*h],t.opt_len+=d*(p+f),o&&(t.static_len+=d*(i[2*h+1]+f)));if(0!==y){do{for(p=u-1;0===t.bl_count[p];)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,y-=2}while(y>0);for(p=u;0!==p;p--)for(h=t.bl_count[p];0!==h;)l=t.heap[--c],l>n||(r[2*l+1]!==p&&(t.opt_len+=(p-r[2*l+1])*r[2*l],r[2*l+1]=p),h--)}})(t,e),O(r,c,t.bl_count)},P=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++a<u&&i===s||(a<c?t.bl_tree[2*i]+=a:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=i,0===s?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4))},C=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++a<u&&i===s)){if(a<c)do{w(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(w(t,i,t.bl_tree),a--),w(t,16,t.bl_tree),b(t,a-3,2)):a<=10?(w(t,17,t.bl_tree),b(t,a-3,3)):(w(t,18,t.bl_tree),b(t,a-11,7));a=0,o=i,0===s?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4)}};let T=!1;const L=(t,e,r,n)=>{b(t,0+(n?1:0),3),((t,e,r)=>{x(t),v(t,r),v(t,~r),t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r})(t,e,r)};t.exports._tr_init=t=>{T||((()=>{let t,e,o,g,m;const v=new Array(16);for(o=0,g=0;g<28;g++)for(h[g]=o,t=0;t<1<<r[g];t++)c[o++]=g;for(c[o-1]=g,m=0,g=0;g<16;g++)for(l[g]=m,t=0;t<1<<n[g];t++)u[m++]=g;for(m>>=7;g<30;g++)for(l[g]=m<<7,t=0;t<1<<n[g]-7;t++)u[256+m++]=g;for(e=0;e<=15;e++)v[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,v[8]++;for(;t<=255;)s[2*t+1]=9,t++,v[9]++;for(;t<=279;)s[2*t+1]=7,t++,v[7]++;for(;t<=287;)s[2*t+1]=8,t++,v[8]++;for(O(s,287,v),t=0;t<30;t++)a[2*t+1]=5,a[2*t]=_(t,5);f=new p(s,r,257,286,15),d=new p(a,n,0,30,15),y=new p(new Array(0),i,0,19,7)})(),T=!0),t.l_desc=new g(t.dyn_ltree,f),t.d_desc=new g(t.dyn_dtree,d),t.bl_desc=new g(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,E(t)},t.exports._tr_stored_block=L,t.exports._tr_flush_block=(t,e,r,n)=>{let i,u,c=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),c=(t=>{let e;for(P(t,t.dyn_ltree,t.l_desc.max_code),P(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*o[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,u=t.static_len+3+7>>>3,u<=i&&(i=u)):i=u=r+5,r+4<=i&&-1!==e?L(t,e,r,n):4===t.strategy||u===i?(b(t,2+(n?1:0),3),S(t,s,a)):(b(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(b(t,e-257,5),b(t,r-1,5),b(t,n-4,4),i=0;i<n;i++)b(t,t.bl_tree[2*o[i]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,c+1),S(t,t.dyn_ltree,t.dyn_dtree)),E(t),n&&x(t)},t.exports._tr_tally=(t,e,r)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(c[r]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.last_lit===t.lit_bufsize-1),t.exports._tr_align=t=>{b(t,2,3),w(t,256,s),(t=>{16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},4442(t){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},6686(){},2698(){},6425(t,e,r){"use strict";function n(t,e){return function(){return t.apply(e,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:s,toStringTag:a}=Symbol,u=(c=Object.create(null),t=>{const e=i.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const h=t=>(t=t.toLowerCase(),e=>u(e)===t),l=t=>e=>typeof e===t,{isArray:p}=Array,f=l("undefined");function d(t){return null!==t&&!f(t)&&null!==t.constructor&&!f(t.constructor)&&m(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const y=h("ArrayBuffer"),g=l("string"),m=l("function"),v=l("number"),b=t=>null!==t&&"object"==typeof t,w=t=>{if("object"!==u(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||a in t||s in t)},_=h("Date"),O=h("File"),E=h("Blob"),x=h("FileList"),j=h("URLSearchParams"),[A,S,R,P]=["ReadableStream","Request","Response","Headers"].map(h);function C(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,i;if("object"!=typeof t&&(t=[t]),p(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(d(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let s;for(n=0;n<o;n++)s=i[n],e.call(null,t[s],s,t)}}function T(t,e){if(d(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n,i=r.length;for(;i-- >0;)if(n=r[i],e===n.toLowerCase())return n;return null}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,k=t=>!f(t)&&t!==L,D=(U="undefined"!=typeof Uint8Array&&o(Uint8Array),t=>U&&t instanceof U);var U;const I=h("HTMLFormElement"),V=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),B=h("RegExp"),z=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};C(r,((r,i)=>{let o;!1!==(o=e(r,i,t))&&(n[i]=o||r)})),Object.defineProperties(t,n)},N=h("AsyncFunction"),F=(Q="function"==typeof setImmediate,W=m(L.postMessage),Q?setImmediate:W?(q=`axios@${Math.random()}`,M=[],L.addEventListener("message",(({source:t,data:e})=>{t===L&&e===q&&M.length&&M.shift()()}),!1),t=>{M.push(t),L.postMessage(q,"*")}):t=>setTimeout(t));var Q,W,q,M;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||F;var G={isArray:p,isArrayBuffer:y,isBuffer:d,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||m(t.append)&&("formdata"===(e=u(t))||"object"===e&&m(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&y(t.buffer),e},isString:g,isNumber:v,isBoolean:t=>!0===t||!1===t,isObject:b,isPlainObject:w,isEmptyObject:t=>{if(!b(t)||d(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:A,isRequest:S,isResponse:R,isHeaders:P,isUndefined:f,isDate:_,isFile:O,isBlob:E,isRegExp:B,isFunction:m,isStream:t=>b(t)&&m(t.pipe),isURLSearchParams:j,isTypedArray:D,isFileList:x,forEach:C,merge:function t(){const{caseless:e,skipUndefined:r}=k(this)&&this||{},n={},i=(i,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=e&&T(n,o)||o;w(n[s])&&w(i)?n[s]=t(n[s],i):w(i)?n[s]=t({},i):p(i)?n[s]=i.slice():r&&f(i)||(n[s]=i)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&C(arguments[t],i);return n},extend:(t,e,r,{allOwnKeys:i}={})=>(C(e,((e,i)=>{r&&m(e)?Object.defineProperty(t,i,{value:n(e,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:e,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:i}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let i,s,a;const u={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],n&&!n(a,t,e)||u[a]||(e[a]=t[a],u[a]=!0);t=!1!==r&&o(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:u,kindOfTest:h,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!v(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[s]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:I,hasOwnProperty:V,hasOwnProp:V,reduceDescriptors:z,freezeMethods:t=>{z(t,((e,r)=>{if(m(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];m(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return p(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:T,global:L,isContextDefined:k,isSpecCompliantForm:function(t){return!!(t&&m(t.append)&&"FormData"===t[a]&&t[s])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(b(t)){if(e.indexOf(t)>=0)return;if(d(t))return t;if(!("toJSON"in t)){e[n]=t;const i=p(t)?[]:{};return C(t,((t,e)=>{const o=r(t,n+1);!f(o)&&(i[e]=o)})),e[n]=void 0,i}}return t};return r(t,0)},isAsyncFn:N,isThenable:t=>t&&(b(t)||m(t))&&m(t.then)&&m(t.catch),setImmediate:F,asap:H,isIterable:t=>null!=t&&m(t[s])};class Z extends Error{static from(t,e,r,n,i,o){const s=new Z(t.message,e||t.code,r,n,i);return s.cause=t,s.name=t.name,o&&Object.assign(s,o),s}constructor(t,e,r,n,i){super(t),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.status}}}Z.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Z.ERR_BAD_OPTION="ERR_BAD_OPTION",Z.ECONNABORTED="ECONNABORTED",Z.ETIMEDOUT="ETIMEDOUT",Z.ERR_NETWORK="ERR_NETWORK",Z.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Z.ERR_DEPRECATED="ERR_DEPRECATED",Z.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Z.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Z.ERR_CANCELED="ERR_CANCELED",Z.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Z.ERR_INVALID_URL="ERR_INVALID_URL";var J=Z;function $(t){return G.isPlainObject(t)||G.isArray(t)}function K(t){return G.endsWith(t,"[]")?t.slice(0,-2):t}function Y(t,e,r){return t?t.concat(e).map((function(t,e){return t=K(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const X=G.toFlatObject(G,{},null,(function(t){return/^is[A-Z]/.test(t)}));function tt(t,e,r){if(!G.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=G.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!G.isUndefined(e[t])}))).metaTokens,i=r.visitor||c,o=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&G.isSpecCompliantForm(e);if(!G.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(G.isDate(t))return t.toISOString();if(G.isBoolean(t))return t.toString();if(!a&&G.isBlob(t))throw new J("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(t)||G.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,r,i){let a=t;if(t&&!i&&"object"==typeof t)if(G.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(G.isArray(t)&&function(t){return G.isArray(t)&&!t.some($)}(t)||(G.isFileList(t)||G.endsWith(r,"[]"))&&(a=G.toArray(t)))return r=K(r),a.forEach((function(t,n){!G.isUndefined(t)&&null!==t&&e.append(!0===s?Y([r],n,o):null===s?r:r+"[]",u(t))})),!1;return!!$(t)||(e.append(Y(i,r,o),u(t)),!1)}const h=[],l=Object.assign(X,{defaultVisitor:c,convertValue:u,isVisitable:$});if(!G.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!G.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),G.forEach(r,(function(r,o){!0===(!(G.isUndefined(r)||null===r)&&i.call(e,r,G.isString(o)?o.trim():o,n,l))&&t(r,n?n.concat(o):[o])})),h.pop()}}(t),e}function et(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function rt(t,e){this._pairs=[],t&&tt(t,this,e)}const nt=rt.prototype;function it(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ot(t,e,r){if(!e)return t;const n=r&&r.encode||it,i=G.isFunction(r)?{serialize:r}:r,o=i&&i.serialize;let s;if(s=o?o(e,i):G.isURLSearchParams(e)?e.toString():new rt(e,i).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}nt.append=function(t,e){this._pairs.push([t,e])},nt.toString=function(t){const e=t?function(e){return t.call(this,e,et)}:et;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var st=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){G.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},at={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ut={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:rt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ct="undefined"!=typeof window&&"undefined"!=typeof document,ht="object"==typeof navigator&&navigator||void 0,lt=ct&&(!ht||["ReactNative","NativeScript","NS"].indexOf(ht.product)<0),pt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ft=ct&&window.location.href||"http://localhost";var dt={...Object.freeze({__proto__:null,hasBrowserEnv:ct,hasStandardBrowserWebWorkerEnv:pt,hasStandardBrowserEnv:lt,navigator:ht,origin:ft}),...ut};function yt(t){function e(t,r,n,i){let o=t[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=t.length;return o=!o&&G.isArray(n)?n.length:o,a?(G.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):(n[o]&&G.isObject(n[o])||(n[o]=[]),e(t,r,n[o],i)&&G.isArray(n[o])&&(n[o]=function(t){const e={},r=Object.keys(t);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],e[o]=t[o];return e}(n[o])),!s)}if(G.isFormData(t)&&G.isFunction(t.entries)){const r={};return G.forEachEntry(t,((t,n)=>{e(function(t){return G.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null}const gt={transitional:at,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,i=G.isObject(t);if(i&&G.isHTMLForm(t)&&(t=new FormData(t)),G.isFormData(t))return n?JSON.stringify(yt(t)):t;if(G.isArrayBuffer(t)||G.isBuffer(t)||G.isStream(t)||G.isFile(t)||G.isBlob(t)||G.isReadableStream(t))return t;if(G.isArrayBufferView(t))return t.buffer;if(G.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return tt(t,new dt.classes.URLSearchParams,{visitor:function(t,e,r,n){return dt.isNode&&G.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((o=G.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return tt(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||n?(e.setContentType("application/json",!1),function(t){if(G.isString(t))try{return(0,JSON.parse)(t),G.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||gt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(G.isResponse(t)||G.isReadableStream(t))return t;if(t&&G.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(t){if(r){if("SyntaxError"===t.name)throw J.from(t,J.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],(t=>{gt.headers[t]={}}));var mt=gt;const vt=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bt=Symbol("internals");function wt(t){return t&&String(t).trim().toLowerCase()}function _t(t){return!1===t||null==t?t:G.isArray(t)?t.map(_t):String(t)}function Ot(t,e,r,n,i){return G.isFunction(n)?n.call(this,e,r):(i&&(e=r),G.isString(e)?G.isString(n)?-1!==e.indexOf(n):G.isRegExp(n)?n.test(e):void 0:void 0)}class Et{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function i(t,e,r){const i=wt(e);if(!i)throw new Error("header name must be a non-empty string");const o=G.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||e]=_t(t))}const o=(t,e)=>G.forEach(t,((t,r)=>i(t,r,e)));if(G.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(G.isString(t)&&(t=t.trim())&&!(t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))(t))o((t=>{const e={};let r,n,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),r=t.substring(0,i).trim().toLowerCase(),n=t.substring(i+1).trim(),!r||e[r]&&vt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(G.isObject(t)&&G.isIterable(t)){let r,n,i={};for(const e of t){if(!G.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[n=e[0]]=(r=i[n])?G.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}o(i,e)}else null!=t&&i(e,t,r);return this}get(t,e){if(t=wt(t)){const r=G.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(G.isFunction(e))return e.call(this,t,r);if(G.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=wt(t)){const r=G.findKey(this,t);return!(!r||void 0===this[r]||e&&!Ot(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function i(t){if(t=wt(t)){const i=G.findKey(r,t);!i||e&&!Ot(0,r[i],i,e)||(delete r[i],n=!0)}}return G.isArray(t)?t.forEach(i):i(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const i=e[r];t&&!Ot(0,this[i],i,t,!0)||(delete this[i],n=!0)}return n}normalize(t){const e=this,r={};return G.forEach(this,((n,i)=>{const o=G.findKey(r,i);if(o)return e[o]=_t(n),void delete e[i];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(i):String(i).trim();s!==i&&delete e[i],e[s]=_t(n),r[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return G.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&G.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[bt]=this[bt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=wt(t);e[n]||(function(t,e){const r=G.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,i){return this[n].call(this,e,t,r,i)},configurable:!0})}))}(r,t),e[n]=!0)}return G.isArray(t)?t.forEach(n):n(t),this}}Et.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(Et.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),G.freezeMethods(Et);var xt=Et;function jt(t,e){const r=this||mt,n=e||r,i=xt.from(n.headers);let o=n.data;return G.forEach(t,(function(t){o=t.call(r,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function At(t){return!(!t||!t.__CANCEL__)}var St=class extends J{constructor(t,e,r){super(null==t?"canceled":t,J.ERR_CANCELED,e,r),this.name="CanceledError",this.__CANCEL__=!0}};function Rt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new J("Request failed with status code "+r.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Pt=(t,e,r=3)=>{let n=0;const i=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i,o=0,s=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=n[s];i||(i=u),r[o]=a,n[o]=u;let h=s,l=0;for(;h!==o;)l+=r[h++],h%=t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),u-i<e)return;const p=c&&u-c;return p?Math.round(1e3*l/p):void 0}}(50,250);return function(r,o){let s,a,u=0,c=1e3/o;const h=(r,o=Date.now())=>{u=o,s=null,a&&(clearTimeout(a),a=null),(r=>{const o=r.loaded,s=r.lengthComputable?r.total:void 0,a=o-n,u=i(a);n=o,t({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&o<=s?(s-o)/u:void 0,event:r,lengthComputable:null!=s,[e?"download":"upload"]:!0})})(...r)};return[(...t)=>{const e=Date.now(),r=e-u;r>=c?h(t,e):(s=t,a||(a=setTimeout((()=>{a=null,h(s)}),c-r)))},()=>s&&h(s)]}(0,r)},Ct=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Tt=t=>(...e)=>G.asap((()=>t(...e)));var Lt=dt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,dt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(dt.origin),dt.navigator&&/(msie|trident)/i.test(dt.navigator.userAgent)):()=>!0,kt=dt.hasStandardBrowserEnv?{write(t,e,r,n,i,o,s){if("undefined"==typeof document)return;const a=[`${t}=${encodeURIComponent(e)}`];G.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),G.isString(n)&&a.push(`path=${n}`),G.isString(i)&&a.push(`domain=${i}`),!0===o&&a.push("secure"),G.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if("undefined"==typeof document)return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Dt(t,e,r){let n=!("string"==typeof(i=e)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Ut=t=>t instanceof xt?{...t}:t;function It(t,e){e=e||{};const r={};function n(t,e,r,n){return G.isPlainObject(t)&&G.isPlainObject(e)?G.merge.call({caseless:n},t,e):G.isPlainObject(e)?G.merge({},e):G.isArray(e)?e.slice():e}function i(t,e,r,i){return G.isUndefined(e)?G.isUndefined(t)?void 0:n(void 0,t,0,i):n(t,e,0,i)}function o(t,e){if(!G.isUndefined(e))return n(void 0,e)}function s(t,e){return G.isUndefined(e)?G.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,i,o){return o in e?n(r,i):o in t?n(void 0,r):void 0}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e,r)=>i(Ut(t),Ut(e),0,!0)};return G.forEach(Object.keys({...t,...e}),(function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;const o=G.hasOwnProp(u,n)?u[n]:i,s=o(t[n],e[n],n);G.isUndefined(s)&&o!==a||(r[n]=s)})),r}var Vt=t=>{const e=It({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=e;if(e.headers=s=xt.from(s),e.url=ot(Dt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),G.isFormData(r))if(dt.hasStandardBrowserEnv||dt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(G.isFunction(r.getHeaders)){const t=r.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach((([t,r])=>{e.includes(t.toLowerCase())&&s.set(t,r)}))}if(dt.hasStandardBrowserEnv&&(n&&G.isFunction(n)&&(n=n(e)),n||!1!==n&&Lt(e.url))){const t=i&&o&&kt.read(o);t&&s.set(i,t)}return e},Bt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=Vt(t);let i=n.data;const o=xt.from(n.headers).normalize();let s,a,u,c,h,{responseType:l,onUploadProgress:p,onDownloadProgress:f}=n;function d(){c&&c(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function g(){if(!y)return;const n=xt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Rt((function(t){e(t),d()}),(function(t){r(t),d()}),{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(r(new J("Request aborted",J.ECONNABORTED,t,y)),y=null)},y.onerror=function(e){const n=e&&e.message?e.message:"Network Error",i=new J(n,J.ERR_NETWORK,t,y);i.event=e||null,r(i),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||at;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new J(e,i.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,y)),y=null},void 0===i&&o.setContentType(null),"setRequestHeader"in y&&G.forEach(o.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),G.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),l&&"json"!==l&&(y.responseType=n.responseType),f&&([u,h]=Pt(f,!0),y.addEventListener("progress",u)),p&&y.upload&&([a,c]=Pt(p),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=e=>{y&&(r(!e||e.type?new St(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);m&&-1===dt.protocols.indexOf(m)?r(new J("Unsupported protocol "+m+":",J.ERR_BAD_REQUEST,t)):y.send(i||null)}))},zt=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const i=function(t){if(!r){r=!0,s();const e=t instanceof Error?t:this.reason;n.abort(e instanceof J?e:new St(e instanceof Error?e.message:e))}};let o=e&&setTimeout((()=>{o=null,i(new J(`timeout of ${e}ms exceeded`,J.ETIMEDOUT))}),e);const s=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)})),t=null)};t.forEach((t=>t.addEventListener("abort",i)));const{signal:a}=n;return a.unsubscribe=()=>G.asap(s),a}};const Nt=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,i=0;for(;i<r;)n=i+e,yield t.slice(i,n),i=n},Ft=(t,e,r,n)=>{const i=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*Nt(r,e)}(t,e);let o,s=0,a=t=>{o||(o=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await i.next();if(e)return a(),void t.close();let o=n.byteLength;if(r){let t=s+=o;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),i.return())},{highWaterMark:2})},{isFunction:Qt}=G,Wt=(({Request:t,Response:e})=>({Request:t,Response:e}))(G.global),{ReadableStream:qt,TextEncoder:Mt}=G.global,Ht=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Gt=t=>{t=G.merge.call({skipUndefined:!0},Wt,t);const{fetch:e,Request:r,Response:n}=t,i=e?Qt(e):"function"==typeof fetch,o=Qt(r),s=Qt(n);if(!i)return!1;const a=i&&Qt(qt),u=i&&("function"==typeof Mt?(c=new Mt,t=>c.encode(t)):async t=>new Uint8Array(await new r(t).arrayBuffer()));var c;const h=o&&a&&Ht((()=>{let t=!1;const e=new r(dt.origin,{body:new qt,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),l=s&&a&&Ht((()=>G.isReadableStream(new n("").body))),p={stream:l&&(t=>t.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!p[t]&&(p[t]=(e,r)=>{let n=e&&e[t];if(n)return n.call(e);throw new J(`Response type '${t}' is not supported`,J.ERR_NOT_SUPPORT,r)})}));return async t=>{let{url:i,method:s,data:a,signal:c,cancelToken:f,timeout:d,onDownloadProgress:y,onUploadProgress:g,responseType:m,headers:v,withCredentials:b="same-origin",fetchOptions:w}=Vt(t),_=e||fetch;m=m?(m+"").toLowerCase():"text";let O=zt([c,f&&f.toAbortSignal()],d),E=null;const x=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let j;try{if(g&&h&&"get"!==s&&"head"!==s&&0!==(j=await(async(t,e)=>{const n=G.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(G.isBlob(t))return t.size;if(G.isSpecCompliantForm(t)){const e=new r(dt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return G.isArrayBufferView(t)||G.isArrayBuffer(t)?t.byteLength:(G.isURLSearchParams(t)&&(t+=""),G.isString(t)?(await u(t)).byteLength:void 0)})(e):n})(v,a))){let t,e=new r(i,{method:"POST",body:a,duplex:"half"});if(G.isFormData(a)&&(t=e.headers.get("content-type"))&&v.setContentType(t),e.body){const[t,r]=Ct(j,Pt(Tt(g)));a=Ft(e.body,65536,t,r)}}G.isString(b)||(b=b?"include":"omit");const e=o&&"credentials"in r.prototype,c={...w,signal:O,method:s.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:e?b:void 0};E=o&&new r(i,c);let f=await(o?_(E,w):_(i,c));const d=l&&("stream"===m||"response"===m);if(l&&(y||d&&x)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=f[e]}));const e=G.toFiniteNumber(f.headers.get("content-length")),[r,i]=y&&Ct(e,Pt(Tt(y),!0))||[];f=new n(Ft(f.body,65536,r,(()=>{i&&i(),x&&x()})),t)}m=m||"text";let A=await p[G.findKey(p,m)||"text"](f,t);return!d&&x&&x(),await new Promise(((e,r)=>{Rt(e,r,{data:A,headers:xt.from(f.headers),status:f.status,statusText:f.statusText,config:t,request:E})}))}catch(e){if(x&&x(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new J("Network Error",J.ERR_NETWORK,t,E,e&&e.response),{cause:e.cause||e});throw J.from(e,e&&e.code,t,E,e&&e.response)}}},Zt=new Map,Jt=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:i}=e,o=[n,i,r];let s,a,u=o.length,c=Zt;for(;u--;)s=o[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:Gt(e)),c=a;return a};Jt();const $t={http:null,xhr:Bt,fetch:{get:Jt}};G.forEach($t,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Kt=t=>`- ${t}`,Yt=t=>G.isFunction(t)||null===t||!1===t;var Xt=function(t,e){t=G.isArray(t)?t:[t];const{length:r}=t;let n,i;const o={};for(let s=0;s<r;s++){let r;if(n=t[s],i=n,!Yt(n)&&(i=$t[(r=String(n)).toLowerCase()],void 0===i))throw new J(`Unknown adapter '${r}'`);if(i&&(G.isFunction(i)||(i=i.get(e))))break;o[r||"#"+s]=i}if(!i){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let e=r?t.length>1?"since :\n"+t.map(Kt).join("\n"):" "+Kt(t[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return i};function te(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new St(null,t)}function ee(t){return te(t),t.headers=xt.from(t.headers),t.data=jt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Xt(t.adapter||mt.adapter,t)(t).then((function(e){return te(t),e.data=jt.call(t,t.transformResponse,e),e.headers=xt.from(e.headers),e}),(function(e){return At(e)||(te(t),e&&e.response&&(e.response.data=jt.call(t,t.transformResponse,e.response),e.response.headers=xt.from(e.response.headers))),Promise.reject(e)}))}const re="1.13.5",ne={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ne[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const ie={};ne.transitional=function(t,e,r){function n(t,e){return"[Axios v"+re+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,i,o)=>{if(!1===t)throw new J(n(i," has been removed"+(e?" in "+e:"")),J.ERR_DEPRECATED);return e&&!ie[i]&&(ie[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,o)}},ne.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};var oe={assertOptions:function(t,e,r){if("object"!=typeof t)throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const o=n[i],s=e[o];if(s){const e=t[o],r=void 0===e||s(e,o,t);if(!0!==r)throw new J("option "+o+" must be "+r,J.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new J("Unknown option "+o,J.ERR_BAD_OPTION)}},validators:ne};const se=oe.validators;class ae{constructor(t){this.defaults=t||{},this.interceptors={request:new st,response:new st}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=It(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:i}=e;void 0!==r&&oe.assertOptions(r,{silentJSONParsing:se.transitional(se.boolean),forcedJSONParsing:se.transitional(se.boolean),clarifyTimeoutError:se.transitional(se.boolean),legacyInterceptorReqResOrdering:se.transitional(se.boolean)},!1),null!=n&&(G.isFunction(n)?e.paramsSerializer={serialize:n}:oe.assertOptions(n,{encode:se.function,serialize:se.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),oe.assertOptions(e,{baseUrl:se.spelling("baseURL"),withXsrfToken:se.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=i&&G.merge(i.common,i[e.method]);i&&G.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=xt.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(e))return;a=a&&t.synchronous;const r=e.transitional||at;r&&r.legacyInterceptorReqResOrdering?s.unshift(t.fulfilled,t.rejected):s.push(t.fulfilled,t.rejected)}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let h,l=0;if(!a){const t=[ee.bind(this),void 0];for(t.unshift(...s),t.push(...u),h=t.length,c=Promise.resolve(e);l<h;)c=c.then(t[l++],t[l++]);return c}h=s.length;let p=e;for(;l<h;){const t=s[l++],e=s[l++];try{p=t(p)}catch(t){e.call(this,t);break}}try{c=ee.call(this,p)}catch(t){return Promise.reject(t)}for(l=0,h=u.length;l<h;)c=c.then(u[l++],u[l++]);return c}getUri(t){return ot(Dt((t=It(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}G.forEach(["delete","get","head","options"],(function(t){ae.prototype[t]=function(e,r){return this.request(It(r||{},{method:t,url:e,data:(r||{}).data}))}})),G.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,i){return this.request(It(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ae.prototype[t]=e(),ae.prototype[t+"Form"]=e(!0)}));var ue=ae;class ce{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,i){r.reason||(r.reason=new St(t,n,i),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ce((function(e){t=e})),cancel:t}}}var he=ce;const le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(le).forEach((([t,e])=>{le[e]=t}));var pe=le;const fe=function t(e){const r=new ue(e),i=n(ue.prototype.request,r);return G.extend(i,ue.prototype,r,{allOwnKeys:!0}),G.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return t(It(e,r))},i}(mt);fe.Axios=ue,fe.CanceledError=St,fe.CancelToken=he,fe.isCancel=At,fe.VERSION=re,fe.toFormData=tt,fe.AxiosError=J,fe.Cancel=fe.CanceledError,fe.all=function(t){return Promise.all(t)},fe.spread=function(t){return function(e){return t.apply(null,e)}},fe.isAxiosError=function(t){return G.isObject(t)&&!0===t.isAxiosError},fe.mergeConfig=It,fe.AxiosHeaders=xt,fe.formToJSON=t=>yt(G.isHTMLForm(t)?new FormData(t):t),fe.getAdapter=Xt,fe.HttpStatusCode=pe,fe.default=fe,t.exports=fe},8330(t){"use strict";t.exports=JSON.parse('{"name":"terminusdb","version":"12.0.2","description":"TerminusDB client library","main":"index.js","types":"./dist/typescript/index.d.ts","files":["*.md","lib","dist"],"directories":{"lib":"lib","test":"test","dist":"dist"},"publishConfig":{"access":"public"},"author":"kevin@terminusdb.com","license":"Apache-2.0","dependencies":{"axios":"^1.7.2","pako":"^2.0.4","buffer":"^6.0.3","form-data":"^4.0.0"},"devDependencies":{"follow-redirects":"^1.14.8","node-forge":"^1.0.0","pathval":"^1.1.1","underscore":"^1.13.2","ts-node":"^10.9.1","jest":"^29.1.2","@babel/core":"^7.13.10","@babel/preset-env":"^7.13.12","@babel/register":"^7.13.8","@types/jest":"^29.1.2","@types/node":"^20.19.27","babel-loader":"^8.0.6","chai":"^4.3.4","concurrently":"^7.4.0","eol":"^0.9.1","eslint":"^8.6.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"6.11.0","eslint-plugin-import":"^2.25.4","eslint-plugin-prettier":"3.1.3","html-webpack-plugin":"^5.3.1","husky":"^7.0.4","jsdoc-to-markdown":"^7.1.0","mocha":"^11.7.5","nyc":"^15.1.0","prettier":"^1.19.1","sinon":"^12.0.1","ts-jest":"^29.0.3","typescript":"^5.9.3","webpack":"^5.36.2","webpack-cli":"^4.6.0","webpack-dev-server":"^5.2.1"},"scripts":{"mkdocs:docs":"npx jsdoc --template ./jsdoc-terminusdb-template --recurse ./lib/ > docs.json","mkdocs:multi":"node ./docs/createDocs.js","mkdocs:src":"docco lib/*.js -l plain -x md -o docs/api","mkdocs:api":"jsdoc2md --configure docs/doc_config.json --partial docs/partial/scope.hbs docs/partial/member-index.hbs docs/partial/header.hbs --helper docs/helper/format.js --files lib/woql.js lib/woqlClient.js lib/typedef.js > docs/api/api.js.md","mkdocs":"cp README.md docs/ && npm run mkdocs:multi","test:integration":"jest","test":"npm run cover","test:only":"mocha --require @babel/register --require @babel/preset-env --recursive ","test:watch":"mocha --watch --require @babel/register --require @babel/preset-env --recursive","test:examples":"node examples/","cover":"nyc --check-coverage --lines 30 npm run test:only ","lint:check":"eslint .","lint":"eslint --fix .","validate-types:strict":"npm run generate-types && tsc --project tsconfig.validate.json","build":"webpack --mode production && npm run generate-types","coveralls-after":"nyc --reporter=lcov mocha --require @babel/register --require @babel/preset-env","npm:publish":"npm publish --access public","test-single":"mocha $1","woql-test":"mocha test/woqlTripleBuilder.spec.js test/woql.spec.js test/woqlTripleBuilder01.spec.js test/woqlExtra.spec.js","git-tag":"git tag $npm_package_version","prepare":"husky install","generate-types":"tsc && node scripts/fix-eval-export.js"},"repository":{"type":"git","url":"git+https://github.com/terminusdb/terminusdb-client-js.git"},"keywords":["Terminus","WOQL","Driver","Database","DB"],"bugs":{"url":"https://github.com/terminusdb/terminusdb-client/issues"},"homepage":"https://github.com/terminusdb/terminusdb-client#readme","browser":{"http":false,"https":false,"net":false,"path":false,"stream":false,"tls":false,"fs":false}}')}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](r,r.exports,__webpack_require__),r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var __webpack_exports__=__webpack_require__(6024);return __webpack_exports__})()));
|
|
3
|
+
//# sourceMappingURL=terminusdb-client.min.js.map
|