@superglue/cli 1.1.175 → 1.1.176
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superglue",
|
|
3
3
|
"description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.176",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "superglue",
|
|
7
7
|
"email": "hello@superglue.cloud"
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var sV=Object.create;var JA=Object.defineProperty;var aV=Object.getOwnPropertyDescriptor;var cV=Object.getOwnPropertyNames;var uV=Object.getPrototypeOf,lV=Object.prototype.hasOwnProperty;var He=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),c_=(t,e)=>{for(var r in e)JA(t,r,{get:e[r],enumerable:!0})},u_=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cV(e))!lV.call(t,i)&&i!==r&&JA(t,i,{get:()=>e[i],enumerable:!(n=aV(e,i))||n.enumerable});return t};var pe=(t,e,r)=>(r=t!=null?sV(uV(t)):{},u_(e||!t||!t.__esModule?JA(r,"default",{value:t,enumerable:!0}):r,t)),hE=t=>u_(JA({},"__esModule",{value:!0}),t);var dr=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.PLAYBOOK_LIMITS=U.MCP_SERVER_AUTH_MODES=U.OAUTH_POPUP_CLOSED_MESSAGE=U.OAUTH_CONTINUATION_REASON_MAX_CHARS=U.AGENT_REQUEST_BUSY_STATUSES=U.AGENT_SESSION_TASK_PREPARATION_METADATA_KEY=U.AGENT_SESSION_USER_OPENED_METADATA_KEY=U.AGENT_SESSION_RESOURCE_KINDS=U.AGENT_MESSAGE_SCHEMA_VERSION=U.AGENT_APPROVAL_MODES=U.ConfirmationAction=U.LOADABLE_MARKDOWN_NAMES=U.SKILL_REFERENCE_NAMES=U.SKILL_BODY_NAMES=U.AGENT_CHECKLIST_MAX_LABEL_CHARS=U.AGENT_CHECKLIST_MAX_ITEMS=U.AGENT_CHECKLIST_MIN_ITEMS=U.DYNAMIC_AGENT_TOOLS=U.AGENT_TOOLS=U.AGENT_NATIVE_TOOLS=U.MEMORY_AGENT_TYPES=U.PLAYBOOK_PLAYGROUND_DRAFT_ID=U.PLAYGROUND_TOOL_DRAFT_ID=U.AgentType=U.FileStatus=U.MAX_BULK_RESOURCE_SHARE_OPERATIONS=U.MAX_BULK_MUTATION_IDS=U.SERVER_MANAGED_CONFIG_FIELDS=U.RunExecutionKind=U.RequestSource=U.RunStatus=U.CredentialMode=U.UpsertMode=U.LogLevel=U.PaginationType=U.DecompressionMethod=U.AuthType=U.FileType=U.CacheMode=U.HttpMethod=U.SupportedFileType=U.RUN_COMMAND_EFFECT_KINDS=U.CONNECTION_PROTOCOLS=U.TURN_CONTEXT_BLOCK_TYPES=void 0;U.isRequestConfig=dV;U.isTransformConfig=AV;U.isAgentSessionOpenedByUser=B_;U.isAgentSessionHiddenUntilOpened=pV;U.TURN_CONTEXT_BLOCK_TYPES=["systems","playbooks","project"];U.CONNECTION_PROTOCOLS=["http","postgres","mssql","redis","mongodb","sftp","smb","odbc","script","suitecloud"];U.RUN_COMMAND_EFFECT_KINDS=["tool","tool_state","system","project","schedule","session","briefing","mcp_server","role","playbook","artifact","share","org_settings","file","memory"];var l_;(function(t){t.JSON="JSON",t.CSV="CSV",t.XML="XML",t.HTML="HTML",t.YAML="YAML",t.EXCEL="EXCEL",t.PDF="PDF",t.DOCX="DOCX",t.PPTX="PPTX",t.ZIP="ZIP",t.GZIP="GZIP",t.QBM="QBM",t.BINARY="BINARY",t.RAW="RAW",t.AUTO="AUTO"})(l_||(U.SupportedFileType=l_={}));var d_;(function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.DELETE="DELETE",t.PATCH="PATCH",t.HEAD="HEAD",t.OPTIONS="OPTIONS"})(d_||(U.HttpMethod=d_={}));var A_;(function(t){t.ENABLED="ENABLED",t.READONLY="READONLY",t.WRITEONLY="WRITEONLY",t.DISABLED="DISABLED"})(A_||(U.CacheMode=A_={}));var p_;(function(t){t.CSV="CSV",t.JSON="JSON",t.XML="XML",t.YAML="YAML",t.EXCEL="EXCEL",t.HTML="HTML",t.PDF="PDF",t.DOCX="DOCX",t.PPTX="PPTX",t.ZIP="ZIP",t.BINARY="BINARY",t.RAW="RAW",t.AUTO="AUTO"})(p_||(U.FileType=p_={}));var f_;(function(t){t.NONE="NONE",t.OAUTH2="OAUTH2",t.HEADER="HEADER",t.QUERY_PARAM="QUERY_PARAM"})(f_||(U.AuthType=f_={}));var h_;(function(t){t.GZIP="GZIP",t.DEFLATE="DEFLATE",t.NONE="NONE",t.AUTO="AUTO",t.ZIP="ZIP"})(h_||(U.DecompressionMethod=h_={}));var g_;(function(t){t.OFFSET_BASED="OFFSET_BASED",t.PAGE_BASED="PAGE_BASED",t.CURSOR_BASED="CURSOR_BASED",t.DISABLED="DISABLED"})(g_||(U.PaginationType=g_={}));var m_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARN="WARN",t.ERROR="ERROR"})(m_||(U.LogLevel=m_={}));var y_;(function(t){t.CREATE="CREATE",t.UPDATE="UPDATE",t.UPSERT="UPSERT"})(y_||(U.UpsertMode=y_={}));var E_;(function(t){t.MERGE="MERGE",t.REPLACE="REPLACE"})(E_||(U.CredentialMode=E_={}));var I_;(function(t){t.RUNNING="RUNNING",t.SUCCESS="SUCCESS",t.FAILED="FAILED",t.ABORTED="ABORTED"})(I_||(U.RunStatus=I_={}));var C_;(function(t){t.API="api",t.FRONTEND="frontend",t.AGENT="agent",t.SCHEDULER="scheduler",t.MCP="mcp",t.TOOL_CHAIN="tool-chain",t.WEBHOOK="webhook",t.CLI="cli"})(C_||(U.RequestSource=C_={}));var b_;(function(t){t.FULL="full",t.DRAFT="draft",t.SINGLE_STEP="single-step"})(b_||(U.RunExecutionKind=b_={}));U.SERVER_MANAGED_CONFIG_FIELDS=["version","createdByUserId","createdAt","updatedAt","lastUsedAt"];U.MAX_BULK_MUTATION_IDS=100;U.MAX_BULK_RESOURCE_SHARE_OPERATIONS=1e3;function dV(t){return!t||typeof t!="object"?!1:t.type==="request"||!("type"in t)||t.type===void 0}function AV(t){return t?.type==="transform"}var S_;(function(t){t.PENDING="PENDING",t.UPLOADING="UPLOADING",t.PROCESSING="PROCESSING",t.COMPLETED="COMPLETED",t.FAILED="FAILED"})(S_||(U.FileStatus=S_={}));var kn;(function(t){t.MAIN="main",t.PLAYGROUND="playground",t.SYSTEM_PLAYGROUND="system_playground",t.PLAYBOOK_PLAYGROUND="playbook_playground",t.ARTIFACT_PLAYGROUND="artifact_playground",t.ACCESS_RULES="access_rules",t.OUTLOOK="outlook"})(kn||(U.AgentType=kn={}));U.PLAYGROUND_TOOL_DRAFT_ID="@playground-draft";U.PLAYBOOK_PLAYGROUND_DRAFT_ID="@playground-draft";U.MEMORY_AGENT_TYPES=[kn.MAIN,kn.OUTLOOK];U.AGENT_NATIVE_TOOLS=["run_command","load_skill","use_checklist","set_credentials","authenticate_oauth","setup_gateway","request_sign_off"];U.AGENT_TOOLS={[kn.MAIN]:[...U.AGENT_NATIVE_TOOLS],[kn.PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.SYSTEM_PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.PLAYBOOK_PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.ARTIFACT_PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.ACCESS_RULES]:[...U.AGENT_NATIVE_TOOLS],[kn.OUTLOOK]:U.AGENT_NATIVE_TOOLS.filter(t=>t!=="use_checklist")};U.DYNAMIC_AGENT_TOOLS=["web_search"];U.AGENT_CHECKLIST_MIN_ITEMS=4;U.AGENT_CHECKLIST_MAX_ITEMS=15;U.AGENT_CHECKLIST_MAX_LABEL_CHARS=120;U.SKILL_BODY_NAMES=["superglue-info","tools","systems","access-management","tool-deployment","notifications","artifacts","playbooks","projects","superglue-brain","email","workspace-apps","meetings","brand-guidelines","demos"];U.SKILL_REFERENCE_NAMES=["http","graphql","postgres","mssql","odbc","redis","mongodb","sftp-smb","suitecloud","task-preparation","acumatica-configuration","sage-intacct-configuration","quickbooks-desktop-files","tool-files","tunnel-handling"];U.LOADABLE_MARKDOWN_NAMES=[...U.SKILL_BODY_NAMES,...U.SKILL_REFERENCE_NAMES];var w_;(function(t){t.CONFIRMED="confirmed",t.DECLINED="declined",t.OAUTH_SUCCESS="oauth_success",t.OAUTH_FAILURE="oauth_failure"})(w_||(U.ConfirmationAction=w_={}));U.AGENT_APPROVAL_MODES=["ask","act"];U.AGENT_MESSAGE_SCHEMA_VERSION=1;U.AGENT_SESSION_RESOURCE_KINDS=["tool","system","playbook","artifact","briefing"];U.AGENT_SESSION_USER_OPENED_METADATA_KEY="userOpened";U.AGENT_SESSION_TASK_PREPARATION_METADATA_KEY="taskPreparation";function B_(t){return t[U.AGENT_SESSION_USER_OPENED_METADATA_KEY]===!0}function pV(t){return(t.resourceBinding?.kind==="briefing"||t.metadata[U.AGENT_SESSION_TASK_PREPARATION_METADATA_KEY]===!0)&&!B_(t.metadata)}U.AGENT_REQUEST_BUSY_STATUSES=["queued","claimed","running","cancelling"];U.OAUTH_CONTINUATION_REASON_MAX_CHARS=500;U.OAUTH_POPUP_CLOSED_MESSAGE="OAuth authentication did not complete.";U.MCP_SERVER_AUTH_MODES=["oauth","creator_api_key"];U.PLAYBOOK_LIMITS={name:120,whenToRun:500,inputs:25e3,instructions:1e5,completionCriteria:25e3,systemRefs:10,toolRefs:25,credentialRefs:10,fileRefs:15,compiledRender:512e3}});var T_=m((eNe,D_)=>{"use strict";var Q_=9007199254740991,fV="[object Arguments]",hV="[object Function]",gV="[object GeneratorFunction]",mV=/^(?:0|[1-9]\d*)$/;function yV(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function EV(t,e){return function(r){return t(e(r))}}var WA=Object.prototype,gE=WA.hasOwnProperty,v_=WA.toString,IV=WA.propertyIsEnumerable,CV=EV(Object.keys,Object);function bV(t,e){var r=vV(t)||QV(t)?yV(t.length,String):[],n=r.length,i=!!n;for(var o in t)(e||gE.call(t,o))&&!(i&&(o=="length"||wV(o,n)))&&r.push(o);return r}function SV(t){if(!BV(t))return CV(t);var e=[];for(var r in Object(t))gE.call(t,r)&&r!="constructor"&&e.push(r);return e}function wV(t,e){return e=e??Q_,!!e&&(typeof t=="number"||mV.test(t))&&t>-1&&t%1==0&&t<e}function BV(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||WA;return t===r}function QV(t){return _V(t)&&gE.call(t,"callee")&&(!IV.call(t,"callee")||v_.call(t)==fV)}var vV=Array.isArray;function __(t){return t!=null&&TV(t.length)&&!DV(t)}function _V(t){return kV(t)&&__(t)}function DV(t){var e=RV(t)?v_.call(t):"";return e==hV||e==gV}function TV(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Q_}function RV(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function kV(t){return!!t&&typeof t=="object"}function NV(t){return __(t)?bV(t):SV(t)}D_.exports=NV});var o0=m((Al,mc)=>{"use strict";var OV=200,F_="__lodash_hash_undefined__",UV=800,MV=16,$_=9007199254740991,j_="[object Arguments]",xV="[object Array]",LV="[object AsyncFunction]",PV="[object Boolean]",FV="[object Date]",$V="[object Error]",q_="[object Function]",jV="[object GeneratorFunction]",qV="[object Map]",zV="[object Number]",HV="[object Null]",z_="[object Object]",GV="[object Proxy]",YV="[object RegExp]",VV="[object Set]",JV="[object String]",WV="[object Undefined]",ZV="[object WeakMap]",KV="[object ArrayBuffer]",XV="[object DataView]",eJ="[object Float32Array]",tJ="[object Float64Array]",rJ="[object Int8Array]",nJ="[object Int16Array]",iJ="[object Int32Array]",oJ="[object Uint8Array]",sJ="[object Uint8ClampedArray]",aJ="[object Uint16Array]",cJ="[object Uint32Array]",uJ=/[\\^$.*+?()[\]{}|]/g,lJ=/^\[object .+?Constructor\]$/,dJ=/^(?:0|[1-9]\d*)$/,Je={};Je[eJ]=Je[tJ]=Je[rJ]=Je[nJ]=Je[iJ]=Je[oJ]=Je[sJ]=Je[aJ]=Je[cJ]=!0;Je[j_]=Je[xV]=Je[KV]=Je[PV]=Je[XV]=Je[FV]=Je[$V]=Je[q_]=Je[qV]=Je[zV]=Je[z_]=Je[YV]=Je[VV]=Je[JV]=Je[ZV]=!1;var H_=typeof global=="object"&&global&&global.Object===Object&&global,AJ=typeof self=="object"&&self&&self.Object===Object&&self,hl=H_||AJ||Function("return this")(),G_=typeof Al=="object"&&Al&&!Al.nodeType&&Al,pl=G_&&typeof mc=="object"&&mc&&!mc.nodeType&&mc,Y_=pl&&pl.exports===G_,mE=Y_&&H_.process,R_=(function(){try{var t=pl&&pl.require&&pl.require("util").types;return t||mE&&mE.binding&&mE.binding("util")}catch{}})(),k_=R_&&R_.isTypedArray;function pJ(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function fJ(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function hJ(t){return function(e){return t(e)}}function gJ(t,e){return t?.[e]}function mJ(t,e){return function(r){return t(e(r))}}var yJ=Array.prototype,EJ=Function.prototype,XA=Object.prototype,yE=hl["__core-js_shared__"],ep=EJ.toString,Eo=XA.hasOwnProperty,N_=(function(){var t=/[^.]+$/.exec(yE&&yE.keys&&yE.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),V_=XA.toString,IJ=ep.call(Object),CJ=RegExp("^"+ep.call(Eo).replace(uJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ZA=Y_?hl.Buffer:void 0,O_=hl.Symbol,U_=hl.Uint8Array,M_=ZA?ZA.allocUnsafe:void 0,J_=mJ(Object.getPrototypeOf,Object),x_=Object.create,bJ=XA.propertyIsEnumerable,SJ=yJ.splice,ra=O_?O_.toStringTag:void 0,KA=(function(){try{var t=wE(Object,"defineProperty");return t({},"",{}),t}catch{}})(),wJ=ZA?ZA.isBuffer:void 0,L_=Math.max,BJ=Date.now,W_=wE(hl,"Map"),fl=wE(Object,"create"),QJ=(function(){function t(){}return function(e){if(!ia(e))return{};if(x_)return x_(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function na(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function vJ(){this.__data__=fl?fl(null):{},this.size=0}function _J(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function DJ(t){var e=this.__data__;if(fl){var r=e[t];return r===F_?void 0:r}return Eo.call(e,t)?e[t]:void 0}function TJ(t){var e=this.__data__;return fl?e[t]!==void 0:Eo.call(e,t)}function RJ(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=fl&&e===void 0?F_:e,this}na.prototype.clear=vJ;na.prototype.delete=_J;na.prototype.get=DJ;na.prototype.has=TJ;na.prototype.set=RJ;function Io(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kJ(){this.__data__=[],this.size=0}function NJ(t){var e=this.__data__,r=tp(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():SJ.call(e,r,1),--this.size,!0}function OJ(t){var e=this.__data__,r=tp(e,t);return r<0?void 0:e[r][1]}function UJ(t){return tp(this.__data__,t)>-1}function MJ(t,e){var r=this.__data__,n=tp(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}Io.prototype.clear=kJ;Io.prototype.delete=NJ;Io.prototype.get=OJ;Io.prototype.has=UJ;Io.prototype.set=MJ;function yc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xJ(){this.size=0,this.__data__={hash:new na,map:new(W_||Io),string:new na}}function LJ(t){var e=np(this,t).delete(t);return this.size-=e?1:0,e}function PJ(t){return np(this,t).get(t)}function FJ(t){return np(this,t).has(t)}function $J(t,e){var r=np(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}yc.prototype.clear=xJ;yc.prototype.delete=LJ;yc.prototype.get=PJ;yc.prototype.has=FJ;yc.prototype.set=$J;function Ec(t){var e=this.__data__=new Io(t);this.size=e.size}function jJ(){this.__data__=new Io,this.size=0}function qJ(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function zJ(t){return this.__data__.get(t)}function HJ(t){return this.__data__.has(t)}function GJ(t,e){var r=this.__data__;if(r instanceof Io){var n=r.__data__;if(!W_||n.length<OV-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new yc(n)}return r.set(t,e),this.size=r.size,this}Ec.prototype.clear=jJ;Ec.prototype.delete=qJ;Ec.prototype.get=zJ;Ec.prototype.has=HJ;Ec.prototype.set=GJ;function YJ(t,e){var r=bE(t),n=!r&&CE(t),i=!r&&!n&&e0(t),o=!r&&!n&&!i&&r0(t),s=r||n||i||o,a=s?fJ(t.length,String):[],c=a.length;for(var u in t)(e||Eo.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||K_(u,c)))&&a.push(u);return a}function EE(t,e,r){(r!==void 0&&!ip(t[e],r)||r===void 0&&!(e in t))&&SE(t,e,r)}function VJ(t,e,r){var n=t[e];(!(Eo.call(t,e)&&ip(n,r))||r===void 0&&!(e in t))&&SE(t,e,r)}function tp(t,e){for(var r=t.length;r--;)if(ip(t[r][0],e))return r;return-1}function SE(t,e,r){e=="__proto__"&&KA?KA(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var JJ=cW();function rp(t){return t==null?t===void 0?WV:HV:ra&&ra in Object(t)?uW(t):hW(t)}function P_(t){return gl(t)&&rp(t)==j_}function WJ(t){if(!ia(t)||pW(t))return!1;var e=QE(t)?CJ:lJ;return e.test(EW(t))}function ZJ(t){return gl(t)&&t0(t.length)&&!!Je[rp(t)]}function KJ(t){if(!ia(t))return fW(t);var e=X_(t),r=[];for(var n in t)n=="constructor"&&(e||!Eo.call(t,n))||r.push(n);return r}function Z_(t,e,r,n,i){t!==e&&JJ(e,function(o,s){if(i||(i=new Ec),ia(o))XJ(t,e,s,r,Z_,n,i);else{var a=n?n(IE(t,s),o,s+"",t,e,i):void 0;a===void 0&&(a=o),EE(t,s,a)}},n0)}function XJ(t,e,r,n,i,o,s){var a=IE(t,r),c=IE(e,r),u=s.get(c);if(u){EE(t,r,u);return}var l=o?o(a,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var A=bE(c),p=!A&&e0(c),h=!A&&!p&&r0(c);l=c,A||p||h?bE(a)?l=a:IW(a)?l=oW(a):p?(d=!1,l=rW(c,!0)):h?(d=!1,l=iW(c,!0)):l=[]:CW(c)||CE(c)?(l=a,CE(a)?l=bW(a):(!ia(a)||QE(a))&&(l=lW(c))):d=!1}d&&(s.set(c,l),i(l,c,n,o,s),s.delete(c)),EE(t,r,l)}function eW(t,e){return mW(gW(t,e,i0),t+"")}var tW=KA?function(t,e){return KA(t,"toString",{configurable:!0,enumerable:!1,value:wW(e),writable:!0})}:i0;function rW(t,e){if(e)return t.slice();var r=t.length,n=M_?M_(r):new t.constructor(r);return t.copy(n),n}function nW(t){var e=new t.constructor(t.byteLength);return new U_(e).set(new U_(t)),e}function iW(t,e){var r=e?nW(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function oW(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function sW(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;c===void 0&&(c=t[a]),i?SE(r,a,c):VJ(r,a,c)}return r}function aW(t){return eW(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&dW(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}function cW(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}function np(t,e){var r=t.__data__;return AW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function wE(t,e){var r=gJ(t,e);return WJ(r)?r:void 0}function uW(t){var e=Eo.call(t,ra),r=t[ra];try{t[ra]=void 0;var n=!0}catch{}var i=V_.call(t);return n&&(e?t[ra]=r:delete t[ra]),i}function lW(t){return typeof t.constructor=="function"&&!X_(t)?QJ(J_(t)):{}}function K_(t,e){var r=typeof t;return e=e??$_,!!e&&(r=="number"||r!="symbol"&&dJ.test(t))&&t>-1&&t%1==0&&t<e}function dW(t,e,r){if(!ia(r))return!1;var n=typeof e;return(n=="number"?BE(r)&&K_(e,r.length):n=="string"&&e in r)?ip(r[e],t):!1}function AW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pW(t){return!!N_&&N_ in t}function X_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||XA;return t===r}function fW(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function hW(t){return V_.call(t)}function gW(t,e,r){return e=L_(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=L_(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),pJ(t,this,a)}}function IE(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var mW=yW(tW);function yW(t){var e=0,r=0;return function(){var n=BJ(),i=MV-(n-r);if(r=n,i>0){if(++e>=UV)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function EW(t){if(t!=null){try{return ep.call(t)}catch{}try{return t+""}catch{}}return""}function ip(t,e){return t===e||t!==t&&e!==e}var CE=P_((function(){return arguments})())?P_:function(t){return gl(t)&&Eo.call(t,"callee")&&!bJ.call(t,"callee")},bE=Array.isArray;function BE(t){return t!=null&&t0(t.length)&&!QE(t)}function IW(t){return gl(t)&&BE(t)}var e0=wJ||BW;function QE(t){if(!ia(t))return!1;var e=rp(t);return e==q_||e==jV||e==LV||e==GV}function t0(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$_}function ia(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function gl(t){return t!=null&&typeof t=="object"}function CW(t){if(!gl(t)||rp(t)!=z_)return!1;var e=J_(t);if(e===null)return!0;var r=Eo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ep.call(r)==IJ}var r0=k_?hJ(k_):ZJ;function bW(t){return sW(t,n0(t))}function n0(t){return BE(t)?YJ(t,!0):KJ(t)}var SW=aW(function(t,e,r){Z_(t,e,r)});function wW(t){return function(){return t}}function i0(t){return t}function BW(){return!1}mc.exports=SW});var E0=m((tNe,y0)=>{"use strict";var u0=200,DE="__lodash_hash_undefined__",QW=1/0,vW=9007199254740991,_W="[object Function]",DW="[object GeneratorFunction]",TW=/[\\^$.*+?()[\]{}|]/g,RW=/^\[object .+?Constructor\]$/,kW=typeof global=="object"&&global&&global.Object===Object&&global,NW=typeof self=="object"&&self&&self.Object===Object&&self,TE=kW||NW||Function("return this")();function OW(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function UW(t,e){for(var r=-1,n=t?t.length:0,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function l0(t,e){var r=t?t.length:0;return!!r&&PW(t,e,0)>-1}function d0(t,e,r){for(var n=-1,i=t?t.length:0;++n<i;)if(r(e,t[n]))return!0;return!1}function MW(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function xW(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function LW(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function PW(t,e,r){if(e!==e)return LW(t,FW,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function FW(t){return t!==t}function $W(t){return function(e){return t(e)}}function A0(t,e){return t.has(e)}function jW(t,e){return t?.[e]}function qW(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function p0(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zW=Array.prototype,HW=Function.prototype,f0=Object.prototype,vE=TE["__core-js_shared__"],s0=(function(){var t=/[^.]+$/.exec(vE&&vE.keys&&vE.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),h0=HW.toString,RE=f0.hasOwnProperty,GW=f0.toString,YW=RegExp("^"+h0.call(RE).replace(TW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),VW=zW.splice,a0=Math.max,JW=kE(TE,"Map"),_E=kE(TE,"Set"),ml=kE(Object,"create");function oa(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function WW(){this.__data__=ml?ml(null):{}}function ZW(t){return this.has(t)&&delete this.__data__[t]}function KW(t){var e=this.__data__;if(ml){var r=e[t];return r===DE?void 0:r}return RE.call(e,t)?e[t]:void 0}function XW(t){var e=this.__data__;return ml?e[t]!==void 0:RE.call(e,t)}function e4(t,e){var r=this.__data__;return r[t]=ml&&e===void 0?DE:e,this}oa.prototype.clear=WW;oa.prototype.delete=ZW;oa.prototype.get=KW;oa.prototype.has=XW;oa.prototype.set=e4;function Ic(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function t4(){this.__data__=[]}function r4(t){var e=this.__data__,r=op(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():VW.call(e,r,1),!0}function n4(t){var e=this.__data__,r=op(e,t);return r<0?void 0:e[r][1]}function i4(t){return op(this.__data__,t)>-1}function o4(t,e){var r=this.__data__,n=op(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Ic.prototype.clear=t4;Ic.prototype.delete=r4;Ic.prototype.get=n4;Ic.prototype.has=i4;Ic.prototype.set=o4;function Cc(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function s4(){this.__data__={hash:new oa,map:new(JW||Ic),string:new oa}}function a4(t){return sp(this,t).delete(t)}function c4(t){return sp(this,t).get(t)}function u4(t){return sp(this,t).has(t)}function l4(t,e){return sp(this,t).set(t,e),this}Cc.prototype.clear=s4;Cc.prototype.delete=a4;Cc.prototype.get=c4;Cc.prototype.has=u4;Cc.prototype.set=l4;function yl(t){var e=-1,r=t?t.length:0;for(this.__data__=new Cc;++e<r;)this.add(t[e])}function d4(t){return this.__data__.set(t,DE),this}function A4(t){return this.__data__.has(t)}yl.prototype.add=yl.prototype.push=d4;yl.prototype.has=A4;function op(t,e){for(var r=t.length;r--;)if(b4(t[r][0],e))return r;return-1}function c0(t,e,r,n){var i=-1,o=l0,s=!0,a=t.length,c=[],u=e.length;if(!a)return c;r&&(e=MW(e,$W(r))),n?(o=d0,s=!1):e.length>=u0&&(o=A0,s=!1,e=new yl(e));e:for(;++i<a;){var l=t[i],d=r?r(l):l;if(l=n||l!==0?l:0,s&&d===d){for(var A=u;A--;)if(e[A]===d)continue e;c.push(l)}else o(e,d,n)||c.push(l)}return c}function p4(t){if(!m0(t)||E4(t))return!1;var e=g0(t)||qW(t)?YW:RW;return e.test(I4(t))}function f4(t,e){return e=a0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,i=a0(r.length-e,0),o=Array(i);++n<i;)o[n]=r[e+n];n=-1;for(var s=Array(e+1);++n<e;)s[n]=r[n];return s[e]=o,OW(t,this,s)}}function h4(t,e,r){var n=-1,i=l0,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=d0;else if(o>=u0){var u=e?null:m4(t);if(u)return p0(u);s=!1,i=A0,c=new yl}else c=e?[]:a;e:for(;++n<o;){var l=t[n],d=e?e(l):l;if(l=r||l!==0?l:0,s&&d===d){for(var A=c.length;A--;)if(c[A]===d)continue e;e&&c.push(d),a.push(l)}else i(c,d,r)||(c!==a&&c.push(d),a.push(l))}return a}function g4(t,e,r){for(var n=-1,i=t.length;++n<i;)var o=o?xW(c0(o,t[n],e,r),c0(t[n],o,e,r)):t[n];return o&&o.length?h4(o,e,r):[]}var m4=_E&&1/p0(new _E([,-0]))[1]==QW?function(t){return new _E(t)}:v4;function sp(t,e){var r=t.__data__;return y4(e)?r[typeof e=="string"?"string":"hash"]:r.map}function kE(t,e){var r=jW(t,e);return p4(r)?r:void 0}function y4(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function E4(t){return!!s0&&s0 in t}function I4(t){if(t!=null){try{return h0.call(t)}catch{}try{return t+""}catch{}}return""}var C4=f4(function(t){return g4(UW(t,w4))});function b4(t,e){return t===e||t!==t&&e!==e}function S4(t){return t!=null&&B4(t.length)&&!g0(t)}function w4(t){return Q4(t)&&S4(t)}function g0(t){var e=m0(t)?GW.call(t):"";return e==_W||e==DW}function B4(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vW}function m0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Q4(t){return!!t&&typeof t=="object"}function v4(){}y0.exports=C4});var cp=m(Co=>{"use strict";var ME=Co&&Co.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Co,"__esModule",{value:!0});Co.toJsonSchema=N4;Co.convertRequiredToArray=El;Co.generateDefaultFromSchema=Il;Co.parseJsonSafe=ap;Co.normalizeToolSchemas=O4;var NE=ME(T_()),OE=ME(o0()),_4=ME(E0());function bc(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;let i=e;return r.every(o=>o in i&&bc(t[o],i[o]))}var D4={required:!1,requiredDepth:Number.POSITIVE_INFINITY,postProcessFnc:null,strings:{preProcessFnc:null},arrays:{mode:"all"},objects:{preProcessFnc:null,postProcessFnc:null,additionalProperties:!0}},T4={string:function(e){return typeof e=="string"},number:function(e){return typeof e=="number"&&isFinite(e)},integer:function(e){return typeof e=="number"&&e%1===0},boolean:function(e){return typeof e=="boolean"},array:function(e){return e instanceof Array},null:function(e){return e===null},date:function(e){return e instanceof Date},any:function(e){return!0},object:function(e){return e&&typeof e=="object"&&!(e instanceof Array)&&!(e instanceof Date)}},Sc={typeNames:["integer","number","string","array","object","boolean","null","date"],getType(t){return Sc.typeNames.find(e=>T4[e](t))},mergeSchemaObjs(t,e){if(!t||!e)return null;let r=(0,NE.default)(t),n=(0,NE.default)(e);if(!bc(r,n)){if(t.type==="array"&&e.type==="array"&&bc((0,_4.default)(r,n),["items"])){let o=r.length>n.length?e:t,s=r.length>n.length?t:e;if((0,NE.default)(o).reduce((c,u)=>bc(o[u],s[u])&&c,!0))return o}if(t.type!=="object"||e.type!=="object")return null}let i={};for(let o=0,{length:s}=r;o<s;o++){let a=r[o];if(Sc.getType(t[a])==="object"){let c=Sc.mergeSchemaObjs(t[a],e[a]);if(c)i[a]=c;else{if(t.type==="object"||e.type==="object")return{type:"object"};if(a!=="items"||t.type!=="array"||e.type!=="array")return null}}else if(a==="type")if(t[a]!==e[a])if(t[a]==="integer"&&e[a]==="number"||t[a]==="number"&&e[a]==="integer")i[a]="number";else return null;else i[a]=t[a];else{if(!bc(t[a],e[a]))return null;i[a]=t[a]}}return i}};function R4(t){let e;for(let r=0,{length:n}=t;r<n;r++){let i=t[r];if(r>0&&(i==="integer"&&e==="number"?i="number":i==="number"&&e==="integer"&&(e="number"),e!==i))return null;e=i}return e}function k4(t){return R4(t.map(e=>Sc.getType(e)))}var UE=class{constructor(e){this.options=(0,OE.default)({},D4,e),this.depth=0,this.getObjectSchemaDefault=this.getObjectSchemaDefault.bind(this),this.getStringSchemaDefault=this.getStringSchemaDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this),this.commmonPostProcessDefault=this.commmonPostProcessDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this)}getCommonArrayItemSchema(e){let r=e.map(n=>{this.depth++;let i=this.getSchema(n);return this.depth--,i});return r.reduce((n,i)=>Sc.mergeSchemaObjs(n,i),r.pop())}getObjectSchemaDefault(e){let r={type:"object"},n=Object.keys(e);return n.length>0&&(r.properties=n.reduce((i,o)=>(this.depth++,i[o]=this.getSchema(e[o]),this.depth--,i),{})),r}getObjectSchema(e){return this.options.objects.preProcessFnc?this.options.objects.preProcessFnc(e,this.getObjectSchemaDefault):this.getObjectSchemaDefault(e)}getArraySchemaMerging(e){let r={type:"array"},n=k4(e);if(n)if(r.items={type:n},n!=="integer"&&n!=="number"){let i=this.getCommonArrayItemSchema(e);i&&(r.items=i)}else this.options.required&&(r.items.required=!0);return r}getArraySchemaNoMerging(e){let r={type:"array"};return e.length>0&&(this.depth++,r.items=this.getSchema(e[0]),this.depth--),r}getArraySchemaTuple(e){let r={type:"array"};return e.length>0&&(r.items=e.map(n=>{this.depth++;let i=this.getSchema(n);return this.depth--,i})),r}getArraySchemaUniform(e){let r=this.getArraySchemaNoMerging(e);if(e.length>1)for(let n=1;n<e.length;n++){this.depth++;let i=this.getSchema(e[n]);if(this.depth--,!bc(r.items,i))throw new Error("Invalid schema, incompatible array items")}return r}getArraySchema(e){if(e.length===0)return{type:"array"};switch(this.options.arrays.mode){case"all":return this.getArraySchemaMerging(e);case"first":return this.getArraySchemaNoMerging(e);case"uniform":return this.getArraySchemaUniform(e);case"tuple":return this.getArraySchemaTuple(e);default:throw new Error(`Unknown array mode option '${this.options.arrays.mode}'`)}}getStringSchemaDefault(e){return{type:"string"}}getStringSchema(e){return this.options.strings.preProcessFnc?this.options.strings.preProcessFnc(e,this.getStringSchemaDefault):this.getStringSchemaDefault(e)}commmonPostProcessDefault(e,r,n){return this.options.required&&this.depth<=this.options.requiredDepth?(0,OE.default)({},r,{required:!0}):r}objectPostProcessDefault(e,r){return this.options.objects.additionalProperties===!1&&Object.getOwnPropertyNames(r).length>0?(0,OE.default)({},e,{additionalProperties:!1}):e}getSchema(e){let r=Sc.getType(e);r||(r="null");let n;switch(r){case"object":n=this.getObjectSchema(e);break;case"array":n=this.getArraySchema(e);break;case"string":n=this.getStringSchema(e);break;default:n={type:r}}return this.options.postProcessFnc?n=this.options.postProcessFnc(r,n,e,this.commmonPostProcessDefault):n=this.commmonPostProcessDefault(r,n,e),r==="object"&&(this.options.objects.postProcessFnc?n=this.options.objects.postProcessFnc(n,e,this.objectPostProcessDefault):n=this.objectPostProcessDefault(n,e)),n}};function N4(t,e){return new UE(e).getSchema(t)}function El(t){if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(r=>El(r));let e={...t};if(delete e.required,e.properties&&typeof e.properties=="object"){let r=[],n={};for(let[i,o]of Object.entries(e.properties)){let s=o;if(s&&typeof s=="object"&&s.required===!0){r.push(i);let{required:a,...c}=s;n[i]=El(c)}else n[i]=El(s)}e.properties=n,r.length>0&&(e.required=r)}return e.items&&(e.items=El(e.items)),e}function Il(t){if(!t||typeof t!="object")return null;if(t.const!==void 0)return t.const;if(t.enum&&Array.isArray(t.enum)&&t.enum.length>0)return t.enum[0];if(t.default!==void 0)return t.default;if(t.oneOf&&Array.isArray(t.oneOf)&&t.oneOf.length>0)return Il(t.oneOf[0]);if(t.anyOf&&Array.isArray(t.anyOf)&&t.anyOf.length>0)return Il(t.anyOf[0]);switch(Array.isArray(t.type)?t.type[0]:t.type){case"string":case"number":case"integer":case"boolean":return null;case"null":return null;case"array":return t.items?[]:[];case"object":let r={};if(t.properties&&typeof t.properties=="object"){let n=t.required||[];for(let[i,o]of Object.entries(t.properties))r[i]=Il(o)}return r;default:if(t.properties&&typeof t.properties=="object"){let n={};for(let[i,o]of Object.entries(t.properties))n[i]=Il(o);return n}return null}}function ap(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function O4(t){let e={...t};return e.inputSchema&&(e.inputSchema=ap(e.inputSchema)),e.outputSchema&&(e.outputSchema=ap(e.outputSchema)),e.responseSchema&&(e.responseSchema=ap(e.responseSchema)),e}});var U4,C0,I0,M4,x4,L4,P4,b0=He(()=>{"use strict";U4=t=>{let e=I0(t,0);if(e===void 0||!x4(t[e]))return;let r=I0(t,e+1);if(r!==void 0)return L4(t,e,r)},C0=U4,I0=(t,e)=>{for(let r=e;r<t.length;r+=1){let n=t[r];if(!M4(n))return r}},M4=t=>t===" "||t===" "||t===`
|
|
2
|
+
"use strict";var sV=Object.create;var JA=Object.defineProperty;var aV=Object.getOwnPropertyDescriptor;var cV=Object.getOwnPropertyNames;var uV=Object.getPrototypeOf,lV=Object.prototype.hasOwnProperty;var He=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),c_=(t,e)=>{for(var r in e)JA(t,r,{get:e[r],enumerable:!0})},u_=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cV(e))!lV.call(t,i)&&i!==r&&JA(t,i,{get:()=>e[i],enumerable:!(n=aV(e,i))||n.enumerable});return t};var pe=(t,e,r)=>(r=t!=null?sV(uV(t)):{},u_(e||!t||!t.__esModule?JA(r,"default",{value:t,enumerable:!0}):r,t)),hE=t=>u_(JA({},"__esModule",{value:!0}),t);var dr=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.PLAYBOOK_LIMITS=U.MCP_SERVER_AUTH_MODES=U.OAUTH_POPUP_CLOSED_MESSAGE=U.OAUTH_CONTINUATION_REASON_MAX_CHARS=U.AGENT_REQUEST_BUSY_STATUSES=U.AGENT_SESSION_TASK_PREPARATION_METADATA_KEY=U.AGENT_SESSION_USER_OPENED_METADATA_KEY=U.AGENT_SESSION_RESOURCE_KINDS=U.AGENT_MESSAGE_SCHEMA_VERSION=U.AGENT_APPROVAL_MODES=U.ConfirmationAction=U.LOADABLE_MARKDOWN_NAMES=U.SKILL_REFERENCE_NAMES=U.SKILL_BODY_NAMES=U.AGENT_CHECKLIST_MAX_LABEL_CHARS=U.AGENT_CHECKLIST_MAX_ITEMS=U.AGENT_CHECKLIST_MIN_ITEMS=U.DYNAMIC_AGENT_TOOLS=U.AGENT_TOOLS=U.AGENT_NATIVE_TOOLS=U.MEMORY_AGENT_TYPES=U.PLAYBOOK_PLAYGROUND_DRAFT_ID=U.PLAYGROUND_TOOL_DRAFT_ID=U.AgentType=U.FileStatus=U.MAX_BULK_RESOURCE_SHARE_OPERATIONS=U.MAX_BULK_MUTATION_IDS=U.SERVER_MANAGED_CONFIG_FIELDS=U.RunExecutionKind=U.RequestSource=U.RunStatus=U.CredentialMode=U.UpsertMode=U.LogLevel=U.PaginationType=U.DecompressionMethod=U.AuthType=U.FileType=U.CacheMode=U.HttpMethod=U.SupportedFileType=U.RUN_COMMAND_EFFECT_KINDS=U.CONNECTION_PROTOCOLS=U.TURN_CONTEXT_BLOCK_TYPES=void 0;U.isRequestConfig=dV;U.isTransformConfig=AV;U.isAgentSessionOpenedByUser=B_;U.isAgentSessionHiddenUntilOpened=pV;U.TURN_CONTEXT_BLOCK_TYPES=["systems","playbooks","project"];U.CONNECTION_PROTOCOLS=["http","postgres","mssql","redis","mongodb","sftp","smb","odbc","script","suitecloud"];U.RUN_COMMAND_EFFECT_KINDS=["tool","tool_state","system","project","schedule","session","briefing","mcp_server","role","playbook","artifact","share","org_settings","file","memory"];var l_;(function(t){t.JSON="JSON",t.CSV="CSV",t.XML="XML",t.HTML="HTML",t.YAML="YAML",t.EXCEL="EXCEL",t.PDF="PDF",t.DOCX="DOCX",t.PPTX="PPTX",t.ZIP="ZIP",t.GZIP="GZIP",t.QBM="QBM",t.BINARY="BINARY",t.RAW="RAW",t.AUTO="AUTO"})(l_||(U.SupportedFileType=l_={}));var d_;(function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.DELETE="DELETE",t.PATCH="PATCH",t.HEAD="HEAD",t.OPTIONS="OPTIONS"})(d_||(U.HttpMethod=d_={}));var A_;(function(t){t.ENABLED="ENABLED",t.READONLY="READONLY",t.WRITEONLY="WRITEONLY",t.DISABLED="DISABLED"})(A_||(U.CacheMode=A_={}));var p_;(function(t){t.CSV="CSV",t.JSON="JSON",t.XML="XML",t.YAML="YAML",t.EXCEL="EXCEL",t.HTML="HTML",t.PDF="PDF",t.DOCX="DOCX",t.PPTX="PPTX",t.ZIP="ZIP",t.BINARY="BINARY",t.RAW="RAW",t.AUTO="AUTO"})(p_||(U.FileType=p_={}));var f_;(function(t){t.NONE="NONE",t.OAUTH2="OAUTH2",t.HEADER="HEADER",t.QUERY_PARAM="QUERY_PARAM"})(f_||(U.AuthType=f_={}));var h_;(function(t){t.GZIP="GZIP",t.DEFLATE="DEFLATE",t.NONE="NONE",t.AUTO="AUTO",t.ZIP="ZIP"})(h_||(U.DecompressionMethod=h_={}));var g_;(function(t){t.OFFSET_BASED="OFFSET_BASED",t.PAGE_BASED="PAGE_BASED",t.CURSOR_BASED="CURSOR_BASED",t.DISABLED="DISABLED"})(g_||(U.PaginationType=g_={}));var m_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARN="WARN",t.ERROR="ERROR"})(m_||(U.LogLevel=m_={}));var y_;(function(t){t.CREATE="CREATE",t.UPDATE="UPDATE",t.UPSERT="UPSERT"})(y_||(U.UpsertMode=y_={}));var E_;(function(t){t.MERGE="MERGE",t.REPLACE="REPLACE"})(E_||(U.CredentialMode=E_={}));var I_;(function(t){t.RUNNING="RUNNING",t.SUCCESS="SUCCESS",t.FAILED="FAILED",t.ABORTED="ABORTED"})(I_||(U.RunStatus=I_={}));var C_;(function(t){t.API="api",t.FRONTEND="frontend",t.AGENT="agent",t.SCHEDULER="scheduler",t.MCP="mcp",t.TOOL_CHAIN="tool-chain",t.WEBHOOK="webhook",t.CLI="cli"})(C_||(U.RequestSource=C_={}));var b_;(function(t){t.FULL="full",t.DRAFT="draft",t.SINGLE_STEP="single-step"})(b_||(U.RunExecutionKind=b_={}));U.SERVER_MANAGED_CONFIG_FIELDS=["version","createdByUserId","createdAt","updatedAt","lastUsedAt"];U.MAX_BULK_MUTATION_IDS=100;U.MAX_BULK_RESOURCE_SHARE_OPERATIONS=1e3;function dV(t){return!t||typeof t!="object"?!1:t.type==="request"||!("type"in t)||t.type===void 0}function AV(t){return t?.type==="transform"}var S_;(function(t){t.PENDING="PENDING",t.UPLOADING="UPLOADING",t.PROCESSING="PROCESSING",t.COMPLETED="COMPLETED",t.FAILED="FAILED"})(S_||(U.FileStatus=S_={}));var kn;(function(t){t.MAIN="main",t.PLAYGROUND="playground",t.SYSTEM_PLAYGROUND="system_playground",t.PLAYBOOK_PLAYGROUND="playbook_playground",t.ARTIFACT_PLAYGROUND="artifact_playground",t.ACCESS_RULES="access_rules",t.OUTLOOK="outlook"})(kn||(U.AgentType=kn={}));U.PLAYGROUND_TOOL_DRAFT_ID="@playground-draft";U.PLAYBOOK_PLAYGROUND_DRAFT_ID="@playground-draft";U.MEMORY_AGENT_TYPES=[kn.MAIN,kn.OUTLOOK];U.AGENT_NATIVE_TOOLS=["run_command","load_skill","use_checklist","set_credentials","authenticate_oauth","setup_gateway","request_sign_off"];U.AGENT_TOOLS={[kn.MAIN]:[...U.AGENT_NATIVE_TOOLS],[kn.PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.SYSTEM_PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.PLAYBOOK_PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.ARTIFACT_PLAYGROUND]:[...U.AGENT_NATIVE_TOOLS],[kn.ACCESS_RULES]:[...U.AGENT_NATIVE_TOOLS],[kn.OUTLOOK]:U.AGENT_NATIVE_TOOLS.filter(t=>t!=="use_checklist")};U.DYNAMIC_AGENT_TOOLS=["web_search"];U.AGENT_CHECKLIST_MIN_ITEMS=4;U.AGENT_CHECKLIST_MAX_ITEMS=15;U.AGENT_CHECKLIST_MAX_LABEL_CHARS=120;U.SKILL_BODY_NAMES=["superglue-info","tools","systems","access-management","tool-deployment","notifications","artifacts","playbooks","projects","superglue-brain","email","workspace-apps","meetings","brand-guidelines","demos","acumatica","netsuite","sage-intacct"];U.SKILL_REFERENCE_NAMES=["http","graphql","postgres","mssql","odbc","redis","mongodb","sftp-smb","suitecloud","task-preparation","acumatica-configuration","acumatica-dependencies","netsuite-dependencies","sage-intacct-dependencies","sage-intacct-configuration","quickbooks-desktop-files","tool-files","tunnel-handling"];U.LOADABLE_MARKDOWN_NAMES=[...U.SKILL_BODY_NAMES,...U.SKILL_REFERENCE_NAMES];var w_;(function(t){t.CONFIRMED="confirmed",t.DECLINED="declined",t.OAUTH_SUCCESS="oauth_success",t.OAUTH_FAILURE="oauth_failure"})(w_||(U.ConfirmationAction=w_={}));U.AGENT_APPROVAL_MODES=["ask","act"];U.AGENT_MESSAGE_SCHEMA_VERSION=1;U.AGENT_SESSION_RESOURCE_KINDS=["tool","system","playbook","artifact","briefing"];U.AGENT_SESSION_USER_OPENED_METADATA_KEY="userOpened";U.AGENT_SESSION_TASK_PREPARATION_METADATA_KEY="taskPreparation";function B_(t){return t[U.AGENT_SESSION_USER_OPENED_METADATA_KEY]===!0}function pV(t){return(t.resourceBinding?.kind==="briefing"||t.metadata[U.AGENT_SESSION_TASK_PREPARATION_METADATA_KEY]===!0)&&!B_(t.metadata)}U.AGENT_REQUEST_BUSY_STATUSES=["queued","claimed","running","cancelling"];U.OAUTH_CONTINUATION_REASON_MAX_CHARS=500;U.OAUTH_POPUP_CLOSED_MESSAGE="OAuth authentication did not complete.";U.MCP_SERVER_AUTH_MODES=["oauth","creator_api_key"];U.PLAYBOOK_LIMITS={name:120,whenToRun:500,inputs:25e3,instructions:1e5,completionCriteria:25e3,systemRefs:10,toolRefs:25,credentialRefs:10,fileRefs:15,compiledRender:512e3}});var T_=m((eNe,D_)=>{"use strict";var Q_=9007199254740991,fV="[object Arguments]",hV="[object Function]",gV="[object GeneratorFunction]",mV=/^(?:0|[1-9]\d*)$/;function yV(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function EV(t,e){return function(r){return t(e(r))}}var WA=Object.prototype,gE=WA.hasOwnProperty,v_=WA.toString,IV=WA.propertyIsEnumerable,CV=EV(Object.keys,Object);function bV(t,e){var r=vV(t)||QV(t)?yV(t.length,String):[],n=r.length,i=!!n;for(var o in t)(e||gE.call(t,o))&&!(i&&(o=="length"||wV(o,n)))&&r.push(o);return r}function SV(t){if(!BV(t))return CV(t);var e=[];for(var r in Object(t))gE.call(t,r)&&r!="constructor"&&e.push(r);return e}function wV(t,e){return e=e??Q_,!!e&&(typeof t=="number"||mV.test(t))&&t>-1&&t%1==0&&t<e}function BV(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||WA;return t===r}function QV(t){return _V(t)&&gE.call(t,"callee")&&(!IV.call(t,"callee")||v_.call(t)==fV)}var vV=Array.isArray;function __(t){return t!=null&&TV(t.length)&&!DV(t)}function _V(t){return kV(t)&&__(t)}function DV(t){var e=RV(t)?v_.call(t):"";return e==hV||e==gV}function TV(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Q_}function RV(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function kV(t){return!!t&&typeof t=="object"}function NV(t){return __(t)?bV(t):SV(t)}D_.exports=NV});var o0=m((Al,mc)=>{"use strict";var OV=200,F_="__lodash_hash_undefined__",UV=800,MV=16,$_=9007199254740991,j_="[object Arguments]",xV="[object Array]",LV="[object AsyncFunction]",PV="[object Boolean]",FV="[object Date]",$V="[object Error]",q_="[object Function]",jV="[object GeneratorFunction]",qV="[object Map]",zV="[object Number]",HV="[object Null]",z_="[object Object]",GV="[object Proxy]",YV="[object RegExp]",VV="[object Set]",JV="[object String]",WV="[object Undefined]",ZV="[object WeakMap]",KV="[object ArrayBuffer]",XV="[object DataView]",eJ="[object Float32Array]",tJ="[object Float64Array]",rJ="[object Int8Array]",nJ="[object Int16Array]",iJ="[object Int32Array]",oJ="[object Uint8Array]",sJ="[object Uint8ClampedArray]",aJ="[object Uint16Array]",cJ="[object Uint32Array]",uJ=/[\\^$.*+?()[\]{}|]/g,lJ=/^\[object .+?Constructor\]$/,dJ=/^(?:0|[1-9]\d*)$/,Je={};Je[eJ]=Je[tJ]=Je[rJ]=Je[nJ]=Je[iJ]=Je[oJ]=Je[sJ]=Je[aJ]=Je[cJ]=!0;Je[j_]=Je[xV]=Je[KV]=Je[PV]=Je[XV]=Je[FV]=Je[$V]=Je[q_]=Je[qV]=Je[zV]=Je[z_]=Je[YV]=Je[VV]=Je[JV]=Je[ZV]=!1;var H_=typeof global=="object"&&global&&global.Object===Object&&global,AJ=typeof self=="object"&&self&&self.Object===Object&&self,hl=H_||AJ||Function("return this")(),G_=typeof Al=="object"&&Al&&!Al.nodeType&&Al,pl=G_&&typeof mc=="object"&&mc&&!mc.nodeType&&mc,Y_=pl&&pl.exports===G_,mE=Y_&&H_.process,R_=(function(){try{var t=pl&&pl.require&&pl.require("util").types;return t||mE&&mE.binding&&mE.binding("util")}catch{}})(),k_=R_&&R_.isTypedArray;function pJ(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function fJ(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function hJ(t){return function(e){return t(e)}}function gJ(t,e){return t?.[e]}function mJ(t,e){return function(r){return t(e(r))}}var yJ=Array.prototype,EJ=Function.prototype,XA=Object.prototype,yE=hl["__core-js_shared__"],ep=EJ.toString,Eo=XA.hasOwnProperty,N_=(function(){var t=/[^.]+$/.exec(yE&&yE.keys&&yE.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),V_=XA.toString,IJ=ep.call(Object),CJ=RegExp("^"+ep.call(Eo).replace(uJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ZA=Y_?hl.Buffer:void 0,O_=hl.Symbol,U_=hl.Uint8Array,M_=ZA?ZA.allocUnsafe:void 0,J_=mJ(Object.getPrototypeOf,Object),x_=Object.create,bJ=XA.propertyIsEnumerable,SJ=yJ.splice,ra=O_?O_.toStringTag:void 0,KA=(function(){try{var t=wE(Object,"defineProperty");return t({},"",{}),t}catch{}})(),wJ=ZA?ZA.isBuffer:void 0,L_=Math.max,BJ=Date.now,W_=wE(hl,"Map"),fl=wE(Object,"create"),QJ=(function(){function t(){}return function(e){if(!ia(e))return{};if(x_)return x_(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function na(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function vJ(){this.__data__=fl?fl(null):{},this.size=0}function _J(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function DJ(t){var e=this.__data__;if(fl){var r=e[t];return r===F_?void 0:r}return Eo.call(e,t)?e[t]:void 0}function TJ(t){var e=this.__data__;return fl?e[t]!==void 0:Eo.call(e,t)}function RJ(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=fl&&e===void 0?F_:e,this}na.prototype.clear=vJ;na.prototype.delete=_J;na.prototype.get=DJ;na.prototype.has=TJ;na.prototype.set=RJ;function Io(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kJ(){this.__data__=[],this.size=0}function NJ(t){var e=this.__data__,r=tp(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():SJ.call(e,r,1),--this.size,!0}function OJ(t){var e=this.__data__,r=tp(e,t);return r<0?void 0:e[r][1]}function UJ(t){return tp(this.__data__,t)>-1}function MJ(t,e){var r=this.__data__,n=tp(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}Io.prototype.clear=kJ;Io.prototype.delete=NJ;Io.prototype.get=OJ;Io.prototype.has=UJ;Io.prototype.set=MJ;function yc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xJ(){this.size=0,this.__data__={hash:new na,map:new(W_||Io),string:new na}}function LJ(t){var e=np(this,t).delete(t);return this.size-=e?1:0,e}function PJ(t){return np(this,t).get(t)}function FJ(t){return np(this,t).has(t)}function $J(t,e){var r=np(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}yc.prototype.clear=xJ;yc.prototype.delete=LJ;yc.prototype.get=PJ;yc.prototype.has=FJ;yc.prototype.set=$J;function Ec(t){var e=this.__data__=new Io(t);this.size=e.size}function jJ(){this.__data__=new Io,this.size=0}function qJ(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function zJ(t){return this.__data__.get(t)}function HJ(t){return this.__data__.has(t)}function GJ(t,e){var r=this.__data__;if(r instanceof Io){var n=r.__data__;if(!W_||n.length<OV-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new yc(n)}return r.set(t,e),this.size=r.size,this}Ec.prototype.clear=jJ;Ec.prototype.delete=qJ;Ec.prototype.get=zJ;Ec.prototype.has=HJ;Ec.prototype.set=GJ;function YJ(t,e){var r=bE(t),n=!r&&CE(t),i=!r&&!n&&e0(t),o=!r&&!n&&!i&&r0(t),s=r||n||i||o,a=s?fJ(t.length,String):[],c=a.length;for(var u in t)(e||Eo.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||K_(u,c)))&&a.push(u);return a}function EE(t,e,r){(r!==void 0&&!ip(t[e],r)||r===void 0&&!(e in t))&&SE(t,e,r)}function VJ(t,e,r){var n=t[e];(!(Eo.call(t,e)&&ip(n,r))||r===void 0&&!(e in t))&&SE(t,e,r)}function tp(t,e){for(var r=t.length;r--;)if(ip(t[r][0],e))return r;return-1}function SE(t,e,r){e=="__proto__"&&KA?KA(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var JJ=cW();function rp(t){return t==null?t===void 0?WV:HV:ra&&ra in Object(t)?uW(t):hW(t)}function P_(t){return gl(t)&&rp(t)==j_}function WJ(t){if(!ia(t)||pW(t))return!1;var e=QE(t)?CJ:lJ;return e.test(EW(t))}function ZJ(t){return gl(t)&&t0(t.length)&&!!Je[rp(t)]}function KJ(t){if(!ia(t))return fW(t);var e=X_(t),r=[];for(var n in t)n=="constructor"&&(e||!Eo.call(t,n))||r.push(n);return r}function Z_(t,e,r,n,i){t!==e&&JJ(e,function(o,s){if(i||(i=new Ec),ia(o))XJ(t,e,s,r,Z_,n,i);else{var a=n?n(IE(t,s),o,s+"",t,e,i):void 0;a===void 0&&(a=o),EE(t,s,a)}},n0)}function XJ(t,e,r,n,i,o,s){var a=IE(t,r),c=IE(e,r),u=s.get(c);if(u){EE(t,r,u);return}var l=o?o(a,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var A=bE(c),p=!A&&e0(c),h=!A&&!p&&r0(c);l=c,A||p||h?bE(a)?l=a:IW(a)?l=oW(a):p?(d=!1,l=rW(c,!0)):h?(d=!1,l=iW(c,!0)):l=[]:CW(c)||CE(c)?(l=a,CE(a)?l=bW(a):(!ia(a)||QE(a))&&(l=lW(c))):d=!1}d&&(s.set(c,l),i(l,c,n,o,s),s.delete(c)),EE(t,r,l)}function eW(t,e){return mW(gW(t,e,i0),t+"")}var tW=KA?function(t,e){return KA(t,"toString",{configurable:!0,enumerable:!1,value:wW(e),writable:!0})}:i0;function rW(t,e){if(e)return t.slice();var r=t.length,n=M_?M_(r):new t.constructor(r);return t.copy(n),n}function nW(t){var e=new t.constructor(t.byteLength);return new U_(e).set(new U_(t)),e}function iW(t,e){var r=e?nW(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function oW(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function sW(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;c===void 0&&(c=t[a]),i?SE(r,a,c):VJ(r,a,c)}return r}function aW(t){return eW(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&dW(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}function cW(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}function np(t,e){var r=t.__data__;return AW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function wE(t,e){var r=gJ(t,e);return WJ(r)?r:void 0}function uW(t){var e=Eo.call(t,ra),r=t[ra];try{t[ra]=void 0;var n=!0}catch{}var i=V_.call(t);return n&&(e?t[ra]=r:delete t[ra]),i}function lW(t){return typeof t.constructor=="function"&&!X_(t)?QJ(J_(t)):{}}function K_(t,e){var r=typeof t;return e=e??$_,!!e&&(r=="number"||r!="symbol"&&dJ.test(t))&&t>-1&&t%1==0&&t<e}function dW(t,e,r){if(!ia(r))return!1;var n=typeof e;return(n=="number"?BE(r)&&K_(e,r.length):n=="string"&&e in r)?ip(r[e],t):!1}function AW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pW(t){return!!N_&&N_ in t}function X_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||XA;return t===r}function fW(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function hW(t){return V_.call(t)}function gW(t,e,r){return e=L_(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=L_(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),pJ(t,this,a)}}function IE(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var mW=yW(tW);function yW(t){var e=0,r=0;return function(){var n=BJ(),i=MV-(n-r);if(r=n,i>0){if(++e>=UV)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function EW(t){if(t!=null){try{return ep.call(t)}catch{}try{return t+""}catch{}}return""}function ip(t,e){return t===e||t!==t&&e!==e}var CE=P_((function(){return arguments})())?P_:function(t){return gl(t)&&Eo.call(t,"callee")&&!bJ.call(t,"callee")},bE=Array.isArray;function BE(t){return t!=null&&t0(t.length)&&!QE(t)}function IW(t){return gl(t)&&BE(t)}var e0=wJ||BW;function QE(t){if(!ia(t))return!1;var e=rp(t);return e==q_||e==jV||e==LV||e==GV}function t0(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$_}function ia(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function gl(t){return t!=null&&typeof t=="object"}function CW(t){if(!gl(t)||rp(t)!=z_)return!1;var e=J_(t);if(e===null)return!0;var r=Eo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ep.call(r)==IJ}var r0=k_?hJ(k_):ZJ;function bW(t){return sW(t,n0(t))}function n0(t){return BE(t)?YJ(t,!0):KJ(t)}var SW=aW(function(t,e,r){Z_(t,e,r)});function wW(t){return function(){return t}}function i0(t){return t}function BW(){return!1}mc.exports=SW});var E0=m((tNe,y0)=>{"use strict";var u0=200,DE="__lodash_hash_undefined__",QW=1/0,vW=9007199254740991,_W="[object Function]",DW="[object GeneratorFunction]",TW=/[\\^$.*+?()[\]{}|]/g,RW=/^\[object .+?Constructor\]$/,kW=typeof global=="object"&&global&&global.Object===Object&&global,NW=typeof self=="object"&&self&&self.Object===Object&&self,TE=kW||NW||Function("return this")();function OW(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function UW(t,e){for(var r=-1,n=t?t.length:0,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function l0(t,e){var r=t?t.length:0;return!!r&&PW(t,e,0)>-1}function d0(t,e,r){for(var n=-1,i=t?t.length:0;++n<i;)if(r(e,t[n]))return!0;return!1}function MW(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function xW(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function LW(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function PW(t,e,r){if(e!==e)return LW(t,FW,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function FW(t){return t!==t}function $W(t){return function(e){return t(e)}}function A0(t,e){return t.has(e)}function jW(t,e){return t?.[e]}function qW(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function p0(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zW=Array.prototype,HW=Function.prototype,f0=Object.prototype,vE=TE["__core-js_shared__"],s0=(function(){var t=/[^.]+$/.exec(vE&&vE.keys&&vE.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),h0=HW.toString,RE=f0.hasOwnProperty,GW=f0.toString,YW=RegExp("^"+h0.call(RE).replace(TW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),VW=zW.splice,a0=Math.max,JW=kE(TE,"Map"),_E=kE(TE,"Set"),ml=kE(Object,"create");function oa(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function WW(){this.__data__=ml?ml(null):{}}function ZW(t){return this.has(t)&&delete this.__data__[t]}function KW(t){var e=this.__data__;if(ml){var r=e[t];return r===DE?void 0:r}return RE.call(e,t)?e[t]:void 0}function XW(t){var e=this.__data__;return ml?e[t]!==void 0:RE.call(e,t)}function e4(t,e){var r=this.__data__;return r[t]=ml&&e===void 0?DE:e,this}oa.prototype.clear=WW;oa.prototype.delete=ZW;oa.prototype.get=KW;oa.prototype.has=XW;oa.prototype.set=e4;function Ic(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function t4(){this.__data__=[]}function r4(t){var e=this.__data__,r=op(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():VW.call(e,r,1),!0}function n4(t){var e=this.__data__,r=op(e,t);return r<0?void 0:e[r][1]}function i4(t){return op(this.__data__,t)>-1}function o4(t,e){var r=this.__data__,n=op(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Ic.prototype.clear=t4;Ic.prototype.delete=r4;Ic.prototype.get=n4;Ic.prototype.has=i4;Ic.prototype.set=o4;function Cc(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function s4(){this.__data__={hash:new oa,map:new(JW||Ic),string:new oa}}function a4(t){return sp(this,t).delete(t)}function c4(t){return sp(this,t).get(t)}function u4(t){return sp(this,t).has(t)}function l4(t,e){return sp(this,t).set(t,e),this}Cc.prototype.clear=s4;Cc.prototype.delete=a4;Cc.prototype.get=c4;Cc.prototype.has=u4;Cc.prototype.set=l4;function yl(t){var e=-1,r=t?t.length:0;for(this.__data__=new Cc;++e<r;)this.add(t[e])}function d4(t){return this.__data__.set(t,DE),this}function A4(t){return this.__data__.has(t)}yl.prototype.add=yl.prototype.push=d4;yl.prototype.has=A4;function op(t,e){for(var r=t.length;r--;)if(b4(t[r][0],e))return r;return-1}function c0(t,e,r,n){var i=-1,o=l0,s=!0,a=t.length,c=[],u=e.length;if(!a)return c;r&&(e=MW(e,$W(r))),n?(o=d0,s=!1):e.length>=u0&&(o=A0,s=!1,e=new yl(e));e:for(;++i<a;){var l=t[i],d=r?r(l):l;if(l=n||l!==0?l:0,s&&d===d){for(var A=u;A--;)if(e[A]===d)continue e;c.push(l)}else o(e,d,n)||c.push(l)}return c}function p4(t){if(!m0(t)||E4(t))return!1;var e=g0(t)||qW(t)?YW:RW;return e.test(I4(t))}function f4(t,e){return e=a0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,i=a0(r.length-e,0),o=Array(i);++n<i;)o[n]=r[e+n];n=-1;for(var s=Array(e+1);++n<e;)s[n]=r[n];return s[e]=o,OW(t,this,s)}}function h4(t,e,r){var n=-1,i=l0,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=d0;else if(o>=u0){var u=e?null:m4(t);if(u)return p0(u);s=!1,i=A0,c=new yl}else c=e?[]:a;e:for(;++n<o;){var l=t[n],d=e?e(l):l;if(l=r||l!==0?l:0,s&&d===d){for(var A=c.length;A--;)if(c[A]===d)continue e;e&&c.push(d),a.push(l)}else i(c,d,r)||(c!==a&&c.push(d),a.push(l))}return a}function g4(t,e,r){for(var n=-1,i=t.length;++n<i;)var o=o?xW(c0(o,t[n],e,r),c0(t[n],o,e,r)):t[n];return o&&o.length?h4(o,e,r):[]}var m4=_E&&1/p0(new _E([,-0]))[1]==QW?function(t){return new _E(t)}:v4;function sp(t,e){var r=t.__data__;return y4(e)?r[typeof e=="string"?"string":"hash"]:r.map}function kE(t,e){var r=jW(t,e);return p4(r)?r:void 0}function y4(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function E4(t){return!!s0&&s0 in t}function I4(t){if(t!=null){try{return h0.call(t)}catch{}try{return t+""}catch{}}return""}var C4=f4(function(t){return g4(UW(t,w4))});function b4(t,e){return t===e||t!==t&&e!==e}function S4(t){return t!=null&&B4(t.length)&&!g0(t)}function w4(t){return Q4(t)&&S4(t)}function g0(t){var e=m0(t)?GW.call(t):"";return e==_W||e==DW}function B4(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vW}function m0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Q4(t){return!!t&&typeof t=="object"}function v4(){}y0.exports=C4});var cp=m(Co=>{"use strict";var ME=Co&&Co.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Co,"__esModule",{value:!0});Co.toJsonSchema=N4;Co.convertRequiredToArray=El;Co.generateDefaultFromSchema=Il;Co.parseJsonSafe=ap;Co.normalizeToolSchemas=O4;var NE=ME(T_()),OE=ME(o0()),_4=ME(E0());function bc(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;let i=e;return r.every(o=>o in i&&bc(t[o],i[o]))}var D4={required:!1,requiredDepth:Number.POSITIVE_INFINITY,postProcessFnc:null,strings:{preProcessFnc:null},arrays:{mode:"all"},objects:{preProcessFnc:null,postProcessFnc:null,additionalProperties:!0}},T4={string:function(e){return typeof e=="string"},number:function(e){return typeof e=="number"&&isFinite(e)},integer:function(e){return typeof e=="number"&&e%1===0},boolean:function(e){return typeof e=="boolean"},array:function(e){return e instanceof Array},null:function(e){return e===null},date:function(e){return e instanceof Date},any:function(e){return!0},object:function(e){return e&&typeof e=="object"&&!(e instanceof Array)&&!(e instanceof Date)}},Sc={typeNames:["integer","number","string","array","object","boolean","null","date"],getType(t){return Sc.typeNames.find(e=>T4[e](t))},mergeSchemaObjs(t,e){if(!t||!e)return null;let r=(0,NE.default)(t),n=(0,NE.default)(e);if(!bc(r,n)){if(t.type==="array"&&e.type==="array"&&bc((0,_4.default)(r,n),["items"])){let o=r.length>n.length?e:t,s=r.length>n.length?t:e;if((0,NE.default)(o).reduce((c,u)=>bc(o[u],s[u])&&c,!0))return o}if(t.type!=="object"||e.type!=="object")return null}let i={};for(let o=0,{length:s}=r;o<s;o++){let a=r[o];if(Sc.getType(t[a])==="object"){let c=Sc.mergeSchemaObjs(t[a],e[a]);if(c)i[a]=c;else{if(t.type==="object"||e.type==="object")return{type:"object"};if(a!=="items"||t.type!=="array"||e.type!=="array")return null}}else if(a==="type")if(t[a]!==e[a])if(t[a]==="integer"&&e[a]==="number"||t[a]==="number"&&e[a]==="integer")i[a]="number";else return null;else i[a]=t[a];else{if(!bc(t[a],e[a]))return null;i[a]=t[a]}}return i}};function R4(t){let e;for(let r=0,{length:n}=t;r<n;r++){let i=t[r];if(r>0&&(i==="integer"&&e==="number"?i="number":i==="number"&&e==="integer"&&(e="number"),e!==i))return null;e=i}return e}function k4(t){return R4(t.map(e=>Sc.getType(e)))}var UE=class{constructor(e){this.options=(0,OE.default)({},D4,e),this.depth=0,this.getObjectSchemaDefault=this.getObjectSchemaDefault.bind(this),this.getStringSchemaDefault=this.getStringSchemaDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this),this.commmonPostProcessDefault=this.commmonPostProcessDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this)}getCommonArrayItemSchema(e){let r=e.map(n=>{this.depth++;let i=this.getSchema(n);return this.depth--,i});return r.reduce((n,i)=>Sc.mergeSchemaObjs(n,i),r.pop())}getObjectSchemaDefault(e){let r={type:"object"},n=Object.keys(e);return n.length>0&&(r.properties=n.reduce((i,o)=>(this.depth++,i[o]=this.getSchema(e[o]),this.depth--,i),{})),r}getObjectSchema(e){return this.options.objects.preProcessFnc?this.options.objects.preProcessFnc(e,this.getObjectSchemaDefault):this.getObjectSchemaDefault(e)}getArraySchemaMerging(e){let r={type:"array"},n=k4(e);if(n)if(r.items={type:n},n!=="integer"&&n!=="number"){let i=this.getCommonArrayItemSchema(e);i&&(r.items=i)}else this.options.required&&(r.items.required=!0);return r}getArraySchemaNoMerging(e){let r={type:"array"};return e.length>0&&(this.depth++,r.items=this.getSchema(e[0]),this.depth--),r}getArraySchemaTuple(e){let r={type:"array"};return e.length>0&&(r.items=e.map(n=>{this.depth++;let i=this.getSchema(n);return this.depth--,i})),r}getArraySchemaUniform(e){let r=this.getArraySchemaNoMerging(e);if(e.length>1)for(let n=1;n<e.length;n++){this.depth++;let i=this.getSchema(e[n]);if(this.depth--,!bc(r.items,i))throw new Error("Invalid schema, incompatible array items")}return r}getArraySchema(e){if(e.length===0)return{type:"array"};switch(this.options.arrays.mode){case"all":return this.getArraySchemaMerging(e);case"first":return this.getArraySchemaNoMerging(e);case"uniform":return this.getArraySchemaUniform(e);case"tuple":return this.getArraySchemaTuple(e);default:throw new Error(`Unknown array mode option '${this.options.arrays.mode}'`)}}getStringSchemaDefault(e){return{type:"string"}}getStringSchema(e){return this.options.strings.preProcessFnc?this.options.strings.preProcessFnc(e,this.getStringSchemaDefault):this.getStringSchemaDefault(e)}commmonPostProcessDefault(e,r,n){return this.options.required&&this.depth<=this.options.requiredDepth?(0,OE.default)({},r,{required:!0}):r}objectPostProcessDefault(e,r){return this.options.objects.additionalProperties===!1&&Object.getOwnPropertyNames(r).length>0?(0,OE.default)({},e,{additionalProperties:!1}):e}getSchema(e){let r=Sc.getType(e);r||(r="null");let n;switch(r){case"object":n=this.getObjectSchema(e);break;case"array":n=this.getArraySchema(e);break;case"string":n=this.getStringSchema(e);break;default:n={type:r}}return this.options.postProcessFnc?n=this.options.postProcessFnc(r,n,e,this.commmonPostProcessDefault):n=this.commmonPostProcessDefault(r,n,e),r==="object"&&(this.options.objects.postProcessFnc?n=this.options.objects.postProcessFnc(n,e,this.objectPostProcessDefault):n=this.objectPostProcessDefault(n,e)),n}};function N4(t,e){return new UE(e).getSchema(t)}function El(t){if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(r=>El(r));let e={...t};if(delete e.required,e.properties&&typeof e.properties=="object"){let r=[],n={};for(let[i,o]of Object.entries(e.properties)){let s=o;if(s&&typeof s=="object"&&s.required===!0){r.push(i);let{required:a,...c}=s;n[i]=El(c)}else n[i]=El(s)}e.properties=n,r.length>0&&(e.required=r)}return e.items&&(e.items=El(e.items)),e}function Il(t){if(!t||typeof t!="object")return null;if(t.const!==void 0)return t.const;if(t.enum&&Array.isArray(t.enum)&&t.enum.length>0)return t.enum[0];if(t.default!==void 0)return t.default;if(t.oneOf&&Array.isArray(t.oneOf)&&t.oneOf.length>0)return Il(t.oneOf[0]);if(t.anyOf&&Array.isArray(t.anyOf)&&t.anyOf.length>0)return Il(t.anyOf[0]);switch(Array.isArray(t.type)?t.type[0]:t.type){case"string":case"number":case"integer":case"boolean":return null;case"null":return null;case"array":return t.items?[]:[];case"object":let r={};if(t.properties&&typeof t.properties=="object"){let n=t.required||[];for(let[i,o]of Object.entries(t.properties))r[i]=Il(o)}return r;default:if(t.properties&&typeof t.properties=="object"){let n={};for(let[i,o]of Object.entries(t.properties))n[i]=Il(o);return n}return null}}function ap(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function O4(t){let e={...t};return e.inputSchema&&(e.inputSchema=ap(e.inputSchema)),e.outputSchema&&(e.outputSchema=ap(e.outputSchema)),e.responseSchema&&(e.responseSchema=ap(e.responseSchema)),e}});var U4,C0,I0,M4,x4,L4,P4,b0=He(()=>{"use strict";U4=t=>{let e=I0(t,0);if(e===void 0||!x4(t[e]))return;let r=I0(t,e+1);if(r!==void 0)return L4(t,e,r)},C0=U4,I0=(t,e)=>{for(let r=e;r<t.length;r+=1){let n=t[r];if(!M4(n))return r}},M4=t=>t===" "||t===" "||t===`
|
|
3
3
|
`||t==="\r",x4=t=>t==="{"||t==="[",L4=(t,e,r)=>{let n;for(let i=r-1;i>e;i-=1){let o=t[i];if(o==="\r")return;if(o===`
|
|
4
4
|
`)return P4(n);if(n===void 0)n=o;else if(n[0]===o)n+=o;else return}},P4=t=>t===void 0?0:t[0]===" "?t.length:t});var S0,xE,F4,$4,w0=He(()=>{"use strict";S0=(t,e)=>{let r=xE(t,"toPrecision",e,e);return r===void 0?xE(t,"toExponential",e,e):r},xE=(t,e,r,n)=>{let o=t[e](n).replace(F4,"$1").replace($4,"$1");return o.length<=r?o:n===1?void 0:xE(t,e,r,n-1)},F4=/(e)\+/iu,$4=/\.?0*($|e)/iu});var Q0,j4,q4,B0,v0=He(()=>{"use strict";Q0=(t,e)=>{if(typeof t!="string")throw new TypeError(`Input must be a JSON string: ${t}`);j4(e)},j4=t=>{if(q4(t),t<0)throw new TypeError(`"maxSize" argument must be positive: ${t}`);if(t<B0)throw new TypeError(`"maxSize" argument must be at least ${B0}: ${t}`)},q4=t=>{if(t===void 0)throw new TypeError('"maxSize" argument must be defined');if(!Number.isInteger(t))throw new TypeError(`"maxSize" argument must be an integer: ${t}`)},B0=7});var up,_0,lp,z4,H4,G4,Y4,D0,V4,J4,W4,Z4,K4,X4,LE=He(()=>{"use strict";up=(t,e,r)=>{let n=D0(e,r);return _0(t,e,n)},_0=(t,e,r)=>{if(r>=e)return r;let n=t[r];return n>=K4&&n<=X4?_0(t,e,r+1):r},lp=(t,e,r)=>{if(r===void 0)return r;let n=D0(e,r);return z4(t,n)},z4=(t,e)=>H4(t,e)?e-3:G4(t,e)?e-2:Y4(t,e)?e-1:e,H4=(t,e)=>e>=3&&t[e-3]>=V4&&t[e-3]<=J4,G4=(t,e)=>e>=2&&t[e-2]>=W4,Y4=(t,e)=>e>=1&&t[e-1]>=Z4,D0=(t,e)=>e<0||Object.is(e,-0)?Math.max(t+e,0):e,V4=240,J4=244,W4=224,Z4=194,K4=128,X4=191});var T0,R0=He(()=>{"use strict";LE();T0=(t,e,r)=>{let n=globalThis.Buffer.from(t),i=up(n,n.length,e),o=lp(n,n.length,r);return i===0&&o>=n.length?n.toString():n.toString("utf8",i,o)}});var k0,N0=He(()=>{"use strict";k0=/[\uD800-\uDFFF]/gu});var dp,tZ,$E=He(()=>{"use strict";N0();dp=t=>tZ(t)?t.replace(k0,"\uFFFD"):t,tZ=t=>{for(let e=0;e<t.length;e+=1){let r=t.codePointAt(e);if(r>=55296&&r<=57343)return!0}return!1}});var jE,O0=He(()=>{"use strict";jE=({input:t,targetByteCount:e,firstStartSurrogate:r,lastStartSurrogate:n,firstEndSurrogate:i,lastEndSurrogate:o,increment:s,canBacktrack:a,shift:c,charIndexInit:u})=>{let l=u,d=l,A=0;for(;A<e;l+=s){d=l;let h=t.charCodeAt(l);if(Number.isNaN(h))break;if(h<=127){A+=1;continue}if(h<=2047){A+=2;continue}if(A+=3,h<r||h>n)continue;let g=t.charCodeAt(l+s);Number.isNaN(g)||g<i||g>o||(A+=1,l+=s)}return(a&&A>e?d:l)+c}});var qE,sZ,aZ,U0=He(()=>{"use strict";O0();qE=(t,e,r)=>e<0||Object.is(e,-0)?aZ(t,e,r):sZ(t,e,r),sZ=(t,e,r)=>jE({input:t,targetByteCount:e,firstStartSurrogate:55296,lastStartSurrogate:56319,firstEndSurrogate:56320,lastEndSurrogate:57343,increment:1,canBacktrack:r,shift:0,charIndexInit:0}),aZ=(t,e,r)=>jE({input:t,targetByteCount:-e,firstStartSurrogate:56320,lastStartSurrogate:57343,firstEndSurrogate:55296,lastEndSurrogate:56319,increment:-1,canBacktrack:!r,shift:1,charIndexInit:t.length-1})});var Ap,cZ,M0=He(()=>{"use strict";$E();U0();Ap=(t,e,r)=>{let n=qE(t,e,!1),i=cZ(t,r),o=n===0&&i===void 0?t:t.slice(n,i);return dp(o)},cZ=(t,e)=>{if(e===void 0)return e;let r=qE(t,e,!0);return r===t.length?void 0:r}});var L0,uZ,zE,x0,lZ,dZ,pp,P0=He(()=>{"use strict";LE();L0=(t,e,r)=>{let{textEncoder:n,textDecoder:i}=uZ(),o=lZ(t),{written:s}=n.encodeInto(t,o),a=up(o,s,e),c=lp(o,s,r),u=c===void 0?s:Math.min(c,s),l=o.subarray(a,u);return i.decode(l)},uZ=()=>(zE===void 0&&(zE=new globalThis.TextEncoder,x0=new globalThis.TextDecoder("utf8",{fatal:!1})),{textEncoder:zE,textDecoder:x0}),lZ=t=>{let e=t.length*3;return e>dZ?new Uint8Array(e):((pp===void 0||pp.length<e)&&(pp=new Uint8Array(e)),pp)},dZ=1e5});var F0,HE,$0,j0=He(()=>{"use strict";F0=(t,e)=>{if(e===void 0)return e;let r=HE(t,e);return r>=t.length*$0?void 0:r},HE=(t,e)=>e<=t.length*-$0?0:e,$0=4});var q0,AZ,pZ,z0,H0=He(()=>{"use strict";q0=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`First argument must be a string: ${t}`);AZ(e),pZ(r)},AZ=t=>{if(t===void 0)throw new TypeError("Second argument is required.");z0("Second",t)},pZ=t=>{t!==void 0&&z0("Third",t)},z0=(t,e)=>{if(!Number.isInteger(e))throw new TypeError(`${t} argument must be an integer: ${e}`)}});var G0,fZ,GE,Y0=He(()=>{"use strict";G0=t=>{let e=!0,r=0;for(let n=0;n<GE;n+=1){let i=fZ(t,n);i<=127||(e&&(e=!1),i>2047&&(r+=1))}return{asciiOnly:e,longCharsPercentage:r/GE}},fZ=(t,e)=>{let r=GE-1,n=1-(r-e)/r,i=Math.round(n*(t.length-1));return t.charCodeAt(i)},GE=50});var hZ,V0,gZ,mZ,yZ,EZ,J0,W0=He(()=>{"use strict";R0();M0();P0();j0();$E();H0();Y0();hZ=(t,e,r)=>{if(q0(t,e,r),t==="")return t;let n=HE(t,e),i=F0(t,r);return i===void 0&&Object.is(n,0)?dp(t):gZ(t,n,i)},V0=hZ,gZ=(t,e,r)=>{if(t.length<=mZ)return Ap(t,e,r);let{asciiOnly:n,longCharsPercentage:i}=G0(t);return n?EZ(t,e,r):i>=yZ?Ap(t,e,r):J0(t,e,r)},mZ=200,yZ=.4,EZ=(t,e,r)=>"Buffer"in globalThis&&"from"in globalThis.Buffer?T0(t,e,r):J0(t,e,r),J0=(t,e,r)=>"TextEncoder"in globalThis?L0(t,e,r):Ap(t,e,r)});var K0,IZ,CZ,bZ,SZ,Cl,Z0,X0=He(()=>{"use strict";W0();K0=(t,e)=>{let r=JSON.stringify(t),n=bZ(r),i=V0(n,0,e-Z0.length-Cl.length*2),s=`${IZ(i)}${Z0}`;return SZ(s)},IZ=t=>t.replace(CZ,""),CZ=/(\\|\\u[0-9a-fA-F]{0,3})$/u,bZ=t=>t.slice(Cl.length,-Cl.length),SZ=t=>`${Cl}${t}${Cl}`,Cl='"',Z0="..."});var eD,tD=He(()=>{"use strict";eD=t=>globalThis.Buffer.byteLength(t)});var YE,wZ,BZ,QZ,vZ,_Z,DZ,rD=He(()=>{"use strict";YE=t=>{let e=t.length,r=e;for(let n=0;n<e;n+=1){let i=t.charCodeAt(n);if(i<=wZ)continue;if(i<=BZ){r+=1;continue}if(r+=2,i<QZ||i>vZ)continue;let o=t.charCodeAt(n+1);o<_Z||o>DZ||(n+=1)}return r},wZ=127,BZ=2047,QZ=55296,vZ=56319,_Z=56320,DZ=57343});var nD,TZ,RZ,kZ,fp,iD=He(()=>{"use strict";nD=()=>TZ.bind(void 0,new TextEncoder),TZ=(t,e)=>{let r=RZ(e);return t.encodeInto(e,r).written},RZ=t=>{let e=t.length*3;return e>kZ?new Uint8Array(e):((fp===void 0||fp.length<e)&&(fp=new Uint8Array(e)),fp)},kZ=1e5});var OZ,UZ,oD,sD=He(()=>{"use strict";tD();rD();iD();OZ=()=>"Buffer"in globalThis&&"byteLength"in globalThis.Buffer?eD:"TextEncoder"in globalThis?UZ.bind(void 0,nD()):YE,UZ=(t,e)=>e.length<100?YE(e):t(e),oD=OZ()});var aD,MZ,xZ,LZ,PZ,VE,cD=He(()=>{"use strict";sD();aD=t=>{if(t===null)return MZ;if(t===!0)return xZ;if(t===!1)return LZ;let e=typeof t;return e==="object"?PZ:e==="number"?JSON.stringify(t).length:VE(t)},MZ=4,xZ=4,LZ=5,PZ=2,VE=t=>oD(JSON.stringify(t))});var hp,lD,dD,AD,FZ,pD,uD,fD,$Z,bl=He(()=>{"use strict";cD();hp=({size:t,increment:e,maxSize:r,truncatedProps:n,path:i,value:o})=>{let s=t+e,a=s>r;return a?{size:t,stop:a,truncatedProps:[...n,{path:i,value:o}]}:{size:s,stop:a,truncatedProps:n}},lD=t=>aD(t),dD=(t,e,r)=>{let n=pD({empty:t,indent:e,depth:r,keySpaceSize:0}),i=fD(t);return n+i},AD=({key:t,empty:e,indent:r,depth:n})=>{let i=pD({empty:e,indent:r,depth:n,keySpaceSize:1}),o=VE(t),s=fD(e);return i+o+FZ+s},FZ=1,pD=({empty:t,indent:e,depth:r,keySpaceSize:n})=>{if(e===void 0)return 0;let i=uD+e*(r+1),o=t?uD+e*r:0;return n+i+o},uD=1,fD=t=>t?0:$Z,$Z=1});var gp,jZ,JE=He(()=>{"use strict";bl();gp=({parent:t,truncatedProps:e,path:r,increment:n,maxSize:i,key:o,empty:s,size:a,truncateValue:c,indent:u,depth:l})=>{let d=t[o],A=[...r,o],{size:p,stop:h,truncatedProps:g}=hp({size:a,increment:n,maxSize:i,truncatedProps:e,path:A,value:d});return h?{empty:s,size:p,truncatedProps:g}:jZ({value:d,truncatedProps:e,path:A,maxSize:i,empty:s,size:a,newSize:p,truncateValue:c,indent:u,depth:l})},jZ=({value:t,truncatedProps:e,path:r,maxSize:n,empty:i,size:o,newSize:s,truncateValue:a,indent:c,depth:u})=>{let{value:l,size:d,truncatedProps:A}=a({value:t,truncatedProps:e,path:r,size:s,maxSize:n,indent:c,depth:u+1});return l===void 0?{empty:i,size:o,truncatedProps:A}:{empty:!1,size:d,value:l,truncatedProps:A}}});var hD,gD=He(()=>{"use strict";JE();bl();hD=({array:t,truncatedProps:e,path:r,size:n,maxSize:i,truncateValue:o,indent:s,depth:a})=>{let c=[],u={empty:!0,size:n,truncatedProps:e};for(let l=0;l<t.length;l+=1){let d=dD(u.empty,s,a);u=gp({parent:t,truncatedProps:u.truncatedProps,path:r,increment:d,maxSize:i,key:l,empty:u.empty,size:u.size,truncateValue:o,indent:s,depth:a}),u.value!==void 0&&c.push(u.value)}return{value:c,size:u.size,truncatedProps:u.truncatedProps}}});var mD,yD=He(()=>{"use strict";JE();bl();mD=({object:t,truncatedProps:e,path:r,size:n,maxSize:i,truncateValue:o,indent:s,depth:a})=>{let c={},u={empty:!0,size:n,truncatedProps:e};for(let l in t){let d=AD({key:l,empty:u.empty,indent:s,depth:a});u=gp({parent:t,truncatedProps:u.truncatedProps,path:r,increment:d,maxSize:i,key:l,empty:u.empty,size:u.size,truncateValue:o,indent:s,depth:a}),u.value!==void 0&&(c[l]=u.value)}return{value:c,size:u.size,truncatedProps:u.truncatedProps}}});var mp,qZ,ED=He(()=>{"use strict";gD();yD();bl();mp=({value:t,truncatedProps:e,path:r,size:n,maxSize:i,indent:o,depth:s})=>{let a=lD(t),{size:c,stop:u,truncatedProps:l}=hp({size:n,increment:a,maxSize:i,truncatedProps:e,path:r,value:t});return u?{value:void 0,size:c,truncatedProps:l}:qZ({value:t,truncatedProps:l,path:r,size:c,maxSize:i,indent:o,depth:s})},qZ=({value:t,truncatedProps:e,path:r,size:n,maxSize:i,indent:o,depth:s})=>typeof t!="object"||t===null?{value:t,size:n,truncatedProps:e}:Array.isArray(t)?hD({array:t,truncatedProps:e,path:r,size:n,maxSize:i,truncateValue:mp,indent:o,depth:s}):mD({object:t,truncatedProps:e,path:r,size:n,maxSize:i,truncateValue:mp,indent:o,depth:s})});var ID={};c_(ID,{default:()=>HZ});var zZ,HZ,GZ,YZ,VZ,CD=He(()=>{"use strict";b0();w0();v0();X0();ED();zZ=(t,e)=>{Q0(t,e);let r=GZ(t),n=YZ(t),{value:i,truncatedProps:o}=mp({value:n,truncatedProps:[],path:[],size:0,maxSize:e,indent:r,depth:0});return{jsonString:VZ({newValue:i,value:n,maxSize:e,indent:r}),truncatedProps:o}},HZ=zZ,GZ=t=>{let e=C0(t);return typeof e=="string"?e.length:e},YZ=t=>{try{return JSON.parse(t)}catch(e){throw new TypeError(`Invalid JSON string: "${t}"
|
|
5
5
|
${e.message}`)}},VZ=({newValue:t,value:e,maxSize:r,indent:n})=>t!==void 0?JSON.stringify(t,void 0,n):typeof e=="number"?S0(e,r):K0(e,r)});var SD=m(bD=>{"use strict";Object.defineProperty(bD,"__esModule",{value:!0})});var rs=m(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.CronField=void 0;var WE=class t{#e=!1;#t=!1;#n=!1;#i=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(e,r={rawValue:""}){if(!Array.isArray(e))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(e.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...r,rawValue:r.rawValue??""},this.#i=e.sort(t.sorter),this.#n=this.options.wildcard!==void 0?this.options.wildcard:this.#o(),this.#e=this.options.rawValue.includes("L")||e.includes("L"),this.#t=this.options.rawValue.includes("?")||e.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#i}static sorter(e,r){let n=typeof e=="number",i=typeof r=="number";return n&&i?e-r:!n&&!i?e.localeCompare(r):n?-1:1}static findNearestValueInList(e,r,n=!1){if(n){for(let i=e.length-1;i>=0;i--)if(e[i]<r)return e[i];return null}for(let i=0;i<e.length;i++)if(e[i]>r)return e[i];return null}findNearestValue(e,r=!1){return this.constructor.findNearestValueInList(this.values,e,r)}serialize(){return{wildcard:this.#n,values:this.#i}}validate(){let e,r=this.chars.length>0?` or chars ${this.chars.join("")}`:"",n=a=>c=>new RegExp(`^\\d{0,2}${c}$`).test(a),i=a=>(e=a,typeof a=="number"?a>=this.min&&a<=this.max:this.chars.some(n(a)));if(!this.#i.every(i))throw new Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${r}`);let s=this.#i.find((a,c)=>this.#i.indexOf(a)!==c);if(s)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${s}`)}#o(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,r)=>r+this.min).every(e=>this.#i.includes(e))}};yp.CronField=WE});var wD=m(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.CronDayOfMonth=void 0;var JZ=rs(),WZ=1,ZZ=31,KZ=Object.freeze(["L"]),ZE=class extends JZ.CronField{static get min(){return WZ}static get max(){return ZZ}static get chars(){return KZ}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,r){super(e,r),this.validate()}get values(){return super.values}};Ep.CronDayOfMonth=ZE});var BD=m(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.CronDayOfWeek=void 0;var XZ=rs(),e6=0,t6=7,r6=Object.freeze(["L"]),KE=class extends XZ.CronField{static get min(){return e6}static get max(){return t6}static get chars(){return r6}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,r){super(e,r),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};Ip.CronDayOfWeek=KE});var QD=m(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.CronHour=void 0;var n6=rs(),i6=0,o6=23,s6=Object.freeze([]),XE=class extends n6.CronField{static get min(){return i6}static get max(){return o6}static get chars(){return s6}constructor(e,r){super(e,r),this.validate()}get values(){return super.values}};Cp.CronHour=XE});var vD=m(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.CronMinute=void 0;var a6=rs(),c6=0,u6=59,l6=Object.freeze([]),eI=class extends a6.CronField{static get min(){return c6}static get max(){return u6}static get chars(){return l6}constructor(e,r){super(e,r),this.validate()}get values(){return super.values}};bp.CronMinute=eI});var nR=m(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});var So=class extends Error{},lI=class extends So{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},dI=class extends So{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},AI=class extends So{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},os=class extends So{},Tp=class extends So{constructor(e){super(`Invalid unit ${e}`)}},Tt=class extends So{},Vn=class extends So{constructor(){super("Zone is an abstract class")}},q="numeric",Un="short",Rr="long",Rp={year:q,month:q,day:q},iT={year:q,month:Un,day:q},d6={year:q,month:Un,day:q,weekday:Un},oT={year:q,month:Rr,day:q},sT={year:q,month:Rr,day:q,weekday:Rr},aT={hour:q,minute:q},cT={hour:q,minute:q,second:q},uT={hour:q,minute:q,second:q,timeZoneName:Un},lT={hour:q,minute:q,second:q,timeZoneName:Rr},dT={hour:q,minute:q,hourCycle:"h23"},AT={hour:q,minute:q,second:q,hourCycle:"h23"},pT={hour:q,minute:q,second:q,hourCycle:"h23",timeZoneName:Un},fT={hour:q,minute:q,second:q,hourCycle:"h23",timeZoneName:Rr},hT={year:q,month:q,day:q,hour:q,minute:q},gT={year:q,month:q,day:q,hour:q,minute:q,second:q},mT={year:q,month:Un,day:q,hour:q,minute:q},yT={year:q,month:Un,day:q,hour:q,minute:q,second:q},A6={year:q,month:Un,day:q,weekday:Un,hour:q,minute:q},ET={year:q,month:Rr,day:q,hour:q,minute:q,timeZoneName:Un},IT={year:q,month:Rr,day:q,hour:q,minute:q,second:q,timeZoneName:Un},CT={year:q,month:Rr,day:q,weekday:Rr,hour:q,minute:q,timeZoneName:Rr},bT={year:q,month:Rr,day:q,weekday:Rr,hour:q,minute:q,second:q,timeZoneName:Rr},as=class{get type(){throw new Vn}get name(){throw new Vn}get ianaName(){return this.name}get isUniversal(){throw new Vn}offsetName(e,r){throw new Vn}formatOffset(e,r){throw new Vn}offset(e){throw new Vn}equals(e){throw new Vn}get isValid(){throw new Vn}},tI=null,_l=class t extends as{static get instance(){return tI===null&&(tI=new t),tI}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return NT(e,r,n)}formatOffset(e,r){return vl(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},pI=new Map;function p6(t){let e=pI.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),pI.set(t,e)),e}var f6={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function h6(t,e){let r=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,o,s,a,c,u,l]=n;return[s,i,o,a,c,u,l]}function g6(t,e){let r=t.formatToParts(e),n=[];for(let i=0;i<r.length;i++){let{type:o,value:s}=r[i],a=f6[o];o==="era"?n[a]=s:he(a)||(n[a]=parseInt(s,10))}return n}var rI=new Map,wo=class t extends as{static create(e){let r=rI.get(e);return r===void 0&&rI.set(e,r=new t(e)),r}static resetCache(){rI.clear(),pI.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return NT(e,r,n,this.name)}formatOffset(e,r){return vl(this.offset(e),r)}offset(e){if(!this.valid)return NaN;let r=new Date(e);if(isNaN(r))return NaN;let n=p6(this.name),[i,o,s,a,c,u,l]=n.formatToParts?g6(n,r):h6(n,r);a==="BC"&&(i=-Math.abs(i)+1);let A=Lp({year:i,month:o,day:s,hour:c===24?0:c,minute:u,second:l,millisecond:0}),p=+r,h=p%1e3;return p-=h>=0?h:1e3+h,(A-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},_D={};function m6(t,e={}){let r=JSON.stringify([t,e]),n=_D[r];return n||(n=new Intl.ListFormat(t,e),_D[r]=n),n}var fI=new Map;function hI(t,e={}){let r=JSON.stringify([t,e]),n=fI.get(r);return n===void 0&&(n=new Intl.DateTimeFormat(t,e),fI.set(r,n)),n}var gI=new Map;function y6(t,e={}){let r=JSON.stringify([t,e]),n=gI.get(r);return n===void 0&&(n=new Intl.NumberFormat(t,e),gI.set(r,n)),n}var mI=new Map;function E6(t,e={}){let{base:r,...n}=e,i=JSON.stringify([t,n]),o=mI.get(i);return o===void 0&&(o=new Intl.RelativeTimeFormat(t,e),mI.set(i,o)),o}var wl=null;function I6(){return wl||(wl=new Intl.DateTimeFormat().resolvedOptions().locale,wl)}var yI=new Map;function ST(t){let e=yI.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),yI.set(t,e)),e}var EI=new Map;function C6(t){let e=EI.get(t);if(!e){let r=new Intl.Locale(t);e="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in e||(e={...wT,...e}),EI.set(t,e)}return e}function b6(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let r=t.indexOf("-u-");if(r===-1)return[t];{let n,i;try{n=hI(t).resolvedOptions(),i=t}catch{let c=t.substring(0,r);n=hI(c).resolvedOptions(),i=c}let{numberingSystem:o,calendar:s}=n;return[i,o,s]}}function S6(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function w6(t){let e=[];for(let r=1;r<=12;r++){let n=tt.utc(2009,r,1);e.push(t(n))}return e}function B6(t){let e=[];for(let r=1;r<=7;r++){let n=tt.utc(2016,11,13+r);e.push(t(n))}return e}function Sp(t,e,r,n){let i=t.listingMode();return i==="error"?null:i==="en"?r(e):n(e)}function Q6(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||ST(t.locale).numberingSystem==="latn"}var II=class{constructor(e,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:o,...s}=n;if(!r||Object.keys(s).length>0){let a={useGrouping:!1,...n};n.padTo>0&&(a.minimumIntegerDigits=n.padTo),this.inf=y6(e,a)}}format(e){if(this.inf){let r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{let r=this.floor?Math.floor(e):RI(e,3);return Et(r,this.padTo)}}},CI=class{constructor(e,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let s=-1*(e.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&wo.create(a).valid?(i=a,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=hI(r,o)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},bI=class{constructor(e,r,n){this.opts={style:"long",...n},!r&&RT()&&(this.rtf=E6(e,n))}format(e,r){return this.rtf?this.rtf.format(e,r):Y6(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}},wT={firstDay:1,minimalDays:4,weekend:[6,7]},Ve=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,r,n,i,o=!1){let s=e||We.defaultLocale,a=s||(o?"en-US":I6()),c=r||We.defaultNumberingSystem,u=n||We.defaultOutputCalendar,l=wI(i)||We.defaultWeekSettings;return new t(a,c,u,l,s)}static resetCache(){wl=null,fI.clear(),gI.clear(),mI.clear(),yI.clear(),EI.clear()}static fromObject({locale:e,numberingSystem:r,outputCalendar:n,weekSettings:i}={}){return t.create(e,r,n,i)}constructor(e,r,n,i,o){let[s,a,c]=b6(e);this.locale=s,this.numberingSystem=r||a||null,this.outputCalendar=n||c||null,this.weekSettings=i,this.intl=S6(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Q6(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,wI(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1){return Sp(this,e,MT,()=>{let n=this.intl==="ja"||this.intl.startsWith("ja-");r&=!n;let i=r?{month:e,day:"numeric"}:{month:e},o=r?"format":"standalone";if(!this.monthsCache[o][e]){let s=n?a=>this.dtFormatter(a,i).format():a=>this.extract(a,i,"month");this.monthsCache[o][e]=w6(s)}return this.monthsCache[o][e]})}weekdays(e,r=!1){return Sp(this,e,PT,()=>{let n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=r?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=B6(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Sp(this,void 0,()=>FT,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[tt.utc(2016,11,13,9),tt.utc(2016,11,13,19)].map(r=>this.extract(r,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Sp(this,e,$T,()=>{let r={era:e};return this.eraCache[e]||(this.eraCache[e]=[tt.utc(-40,1,1),tt.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[e]})}extract(e,r,n){let i=this.dtFormatter(e,r),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===n);return s?s.value:null}numberFormatter(e={}){return new II(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new CI(e,this.intl,r)}relFormatter(e={}){return new bI(this.intl,this.isEnglish(),e)}listFormatter(e={}){return m6(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ST(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:kT()?C6(this.locale):wT}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},nI=null,kr=class t extends as{static get utcInstance(){return nI===null&&(nI=new t(0)),nI}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new t(Pp(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${vl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${vl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return vl(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},kp=class extends as{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function is(t,e){if(he(t)||t===null)return e;if(t instanceof as)return t;if(k6(t)){let r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?_l.instance:r==="utc"||r==="gmt"?kr.utcInstance:kr.parseSpecifier(r)||wo.create(t)}else return ss(t)?kr.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new kp(t)}var vI={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},DD={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},v6=vI.hanidec.replace(/[\[|\]]/g,"").split("");function _6(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);if(t[r].search(vI.hanidec)!==-1)e+=v6.indexOf(t[r]);else for(let i in DD){let[o,s]=DD[i];n>=o&&n<=s&&(e+=n-o)}}return parseInt(e,10)}else return e}var SI=new Map;function D6(){SI.clear()}function Nn({numberingSystem:t},e=""){let r=t||"latn",n=SI.get(r);n===void 0&&(n=new Map,SI.set(r,n));let i=n.get(e);return i===void 0&&(i=new RegExp(`${vI[r]}${e}`),n.set(e,i)),i}var TD=()=>Date.now(),RD="system",kD=null,ND=null,OD=null,UD=60,MD,xD=null,We=class{static get now(){return TD}static set now(e){TD=e}static set defaultZone(e){RD=e}static get defaultZone(){return is(RD,_l.instance)}static get defaultLocale(){return kD}static set defaultLocale(e){kD=e}static get defaultNumberingSystem(){return ND}static set defaultNumberingSystem(e){ND=e}static get defaultOutputCalendar(){return OD}static set defaultOutputCalendar(e){OD=e}static get defaultWeekSettings(){return xD}static set defaultWeekSettings(e){xD=wI(e)}static get twoDigitCutoffYear(){return UD}static set twoDigitCutoffYear(e){UD=e%100}static get throwOnInvalid(){return MD}static set throwOnInvalid(e){MD=e}static resetCaches(){Ve.resetCache(),wo.resetCache(),tt.resetCache(),D6()}},Tr=class{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},BT=[0,31,59,90,120,151,181,212,243,273,304,334],QT=[0,31,60,91,121,152,182,213,244,274,305,335];function tn(t,e){return new Tr("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function _I(t,e,r){let n=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function vT(t,e,r){return r+(Tl(t)?QT:BT)[e-1]}function _T(t,e){let r=Tl(t)?QT:BT,n=r.findIndex(o=>o<e),i=e-r[n];return{month:n+1,day:i}}function DI(t,e){return(t-e+7)%7+1}function Np(t,e=4,r=1){let{year:n,month:i,day:o}=t,s=vT(n,i,o),a=DI(_I(n,i,o),r),c=Math.floor((s-a+14-e)/7),u;return c<1?(u=n-1,c=Dl(u,e,r)):c>Dl(n,e,r)?(u=n+1,c=1):u=n,{weekYear:u,weekNumber:c,weekday:a,...Fp(t)}}function LD(t,e=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=t,s=DI(_I(n,1,e),r),a=vc(n),c=i*7+o-s-7+e,u;c<1?(u=n-1,c+=vc(u)):c>a?(u=n+1,c-=vc(n)):u=n;let{month:l,day:d}=_T(u,c);return{year:u,month:l,day:d,...Fp(t)}}function iI(t){let{year:e,month:r,day:n}=t,i=vT(e,r,n);return{year:e,ordinal:i,...Fp(t)}}function PD(t){let{year:e,ordinal:r}=t,{month:n,day:i}=_T(e,r);return{year:e,month:n,day:i,...Fp(t)}}function FD(t,e){if(!he(t.localWeekday)||!he(t.localWeekNumber)||!he(t.localWeekYear)){if(!he(t.weekday)||!he(t.weekNumber)||!he(t.weekYear))throw new os("Cannot mix locale-based week fields with ISO-based week fields");return he(t.localWeekday)||(t.weekday=t.localWeekday),he(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),he(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function T6(t,e=4,r=1){let n=xp(t.weekYear),i=rn(t.weekNumber,1,Dl(t.weekYear,e,r)),o=rn(t.weekday,1,7);return n?i?o?!1:tn("weekday",t.weekday):tn("week",t.weekNumber):tn("weekYear",t.weekYear)}function R6(t){let e=xp(t.year),r=rn(t.ordinal,1,vc(t.year));return e?r?!1:tn("ordinal",t.ordinal):tn("year",t.year)}function DT(t){let e=xp(t.year),r=rn(t.month,1,12),n=rn(t.day,1,Op(t.year,t.month));return e?r?n?!1:tn("day",t.day):tn("month",t.month):tn("year",t.year)}function TT(t){let{hour:e,minute:r,second:n,millisecond:i}=t,o=rn(e,0,23)||e===24&&r===0&&n===0&&i===0,s=rn(r,0,59),a=rn(n,0,59),c=rn(i,0,999);return o?s?a?c?!1:tn("millisecond",i):tn("second",n):tn("minute",r):tn("hour",e)}function he(t){return typeof t>"u"}function ss(t){return typeof t=="number"}function xp(t){return typeof t=="number"&&t%1===0}function k6(t){return typeof t=="string"}function N6(t){return Object.prototype.toString.call(t)==="[object Date]"}function RT(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function kT(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function O6(t){return Array.isArray(t)?t:[t]}function $D(t,e,r){if(t.length!==0)return t.reduce((n,i)=>{let o=[e(i),i];return n&&r(n[0],o[0])===n[0]?n:o},null)[1]}function U6(t,e){return e.reduce((r,n)=>(r[n]=t[n],r),{})}function Dc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function wI(t){if(t==null)return null;if(typeof t!="object")throw new Tt("Week settings must be an object");if(!rn(t.firstDay,1,7)||!rn(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!rn(e,1,7)))throw new Tt("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function rn(t,e,r){return xp(t)&&t>=e&&t<=r}function M6(t,e){return t-e*Math.floor(t/e)}function Et(t,e=2){let r=t<0,n;return r?n="-"+(""+-t).padStart(e,"0"):n=(""+t).padStart(e,"0"),n}function ns(t){if(!(he(t)||t===null||t===""))return parseInt(t,10)}function sa(t){if(!(he(t)||t===null||t===""))return parseFloat(t)}function TI(t){if(!(he(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function RI(t,e,r="round"){let n=10**e;switch(r){case"expand":return t>0?Math.ceil(t*n)/n:Math.floor(t*n)/n;case"trunc":return Math.trunc(t*n)/n;case"round":return Math.round(t*n)/n;case"floor":return Math.floor(t*n)/n;case"ceil":return Math.ceil(t*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function Tl(t){return t%4===0&&(t%100!==0||t%400===0)}function vc(t){return Tl(t)?366:365}function Op(t,e){let r=M6(e-1,12)+1,n=t+(e-r)/12;return r===2?Tl(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Lp(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function jD(t,e,r){return-DI(_I(t,1,e),r)+e-1}function Dl(t,e=4,r=1){let n=jD(t,e,r),i=jD(t+1,e,r);return(vc(t)-n+i)/7}function BI(t){return t>99?t:t>We.twoDigitCutoffYear?1900+t:2e3+t}function NT(t,e,r,n=null){let i=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let s={timeZoneName:e,...o},a=new Intl.DateTimeFormat(r,s).formatToParts(i).find(c=>c.type.toLowerCase()==="timezonename");return a?a.value:null}function Pp(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);let n=parseInt(e,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function OT(t){let e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new Tt(`Invalid unit value ${t}`);return e}function Up(t,e){let r={};for(let n in t)if(Dc(t,n)){let i=t[n];if(i==null)continue;r[e(n)]=OT(i)}return r}function vl(t,e){let r=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${Et(r,2)}:${Et(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${Et(r,2)}${Et(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Fp(t){return U6(t,["hour","minute","second","millisecond"])}var x6=["January","February","March","April","May","June","July","August","September","October","November","December"],UT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],L6=["J","F","M","A","M","J","J","A","S","O","N","D"];function MT(t){switch(t){case"narrow":return[...L6];case"short":return[...UT];case"long":return[...x6];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var xT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],LT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],P6=["M","T","W","T","F","S","S"];function PT(t){switch(t){case"narrow":return[...P6];case"short":return[...LT];case"long":return[...xT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var FT=["AM","PM"],F6=["Before Christ","Anno Domini"],$6=["BC","AD"],j6=["B","A"];function $T(t){switch(t){case"narrow":return[...j6];case"short":return[...$6];case"long":return[...F6];default:return null}}function q6(t){return FT[t.hour<12?0:1]}function z6(t,e){return PT(e)[t.weekday-1]}function H6(t,e){return MT(e)[t.month-1]}function G6(t,e){return $T(e)[t.year<0?0:1]}function Y6(t,e,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&o){let d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${i[t][0]}`;case-1:return d?"yesterday":`last ${i[t][0]}`;case 0:return d?"today":`this ${i[t][0]}`}}let s=Object.is(e,-0)||e<0,a=Math.abs(e),c=a===1,u=i[t],l=n?c?u[1]:u[2]||u[1]:c?i[t][0]:t;return s?`${a} ${l} ago`:`in ${a} ${l}`}function qD(t,e){let r="";for(let n of t)n.literal?r+=n.val:r+=e(n.val);return r}var V6={D:Rp,DD:iT,DDD:oT,DDDD:sT,t:aT,tt:cT,ttt:uT,tttt:lT,T:dT,TT:AT,TTT:pT,TTTT:fT,f:hT,ff:mT,fff:ET,ffff:CT,F:gT,FF:yT,FFF:IT,FFFF:bT},Dr=class t{static create(e,r={}){return new t(e,r)}static parseFormat(e){let r=null,n="",i=!1,o=[];for(let s=0;s<e.length;s++){let a=e.charAt(s);a==="'"?((n.length>0||i)&&o.push({literal:i||/^\s+$/.test(n),val:n===""?"'":n}),r=null,n="",i=!i):i||a===r?n+=a:(n.length>0&&o.push({literal:/^\s+$/.test(n),val:n}),n=a,r=a)}return n.length>0&&o.push({literal:i||/^\s+$/.test(n),val:n}),o}static macroTokenToFormatOpts(e){return V6[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}dtFormatter(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r})}formatDateTime(e,r){return this.dtFormatter(e,r).format()}formatDateTimeParts(e,r){return this.dtFormatter(e,r).formatToParts()}formatInterval(e,r){return this.dtFormatter(e.start,r).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r){return this.dtFormatter(e,r).resolvedOptions()}num(e,r=0,n=void 0){if(this.opts.forceSimple)return Et(e,r);let i={...this.opts};return r>0&&(i.padTo=r),n&&(i.signDisplay=n),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(p,h)=>this.loc.extract(e,p,h),s=p=>e.isOffsetFixed&&e.offset===0&&p.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,p.format):"",a=()=>n?q6(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(p,h)=>n?H6(e,p):o(h?{month:p}:{month:p,day:"numeric"},"month"),u=(p,h)=>n?z6(e,p):o(h?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),l=p=>{let h=t.macroTokenToFormatOpts(p);return h?this.formatWithSystemDefault(e,h):p},d=p=>n?G6(e,p):o({era:p},"era"),A=p=>{switch(p){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(p)}};return qD(t.parseFormat(r),A)}formatDurationFromString(e,r){let n=this.opts.signMode==="negativeLargestOnly"?-1:1,i=l=>{switch(l[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},o=(l,d)=>A=>{let p=i(A);if(p){let h=d.isNegativeDuration&&p!==d.largestUnit?n:1,g;return this.opts.signMode==="negativeLargestOnly"&&p!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(l.get(p)*h,A.length,g)}else return A},s=t.parseFormat(r),a=s.reduce((l,{literal:d,val:A})=>d?l:l.concat(A),[]),c=e.shiftTo(...a.map(i).filter(l=>l)),u={isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]};return qD(s,o(c,u))}},jT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Tc(...t){let e=t.reduce((r,n)=>r+n.source,"");return RegExp(`^${e}$`)}function Rc(...t){return e=>t.reduce(([r,n,i],o)=>{let[s,a,c]=o(e,i);return[{...r,...s},a||n,c]},[{},null,1]).slice(0,2)}function kc(t,...e){if(t==null)return[null,null];for(let[r,n]of e){let i=r.exec(t);if(i)return n(i)}return[null,null]}function qT(...t){return(e,r)=>{let n={},i;for(i=0;i<t.length;i++)n[t[i]]=ns(e[r+i]);return[n,null,r+i]}}var zT=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,J6=`(?:${zT.source}?(?:\\[(${jT.source})\\])?)?`,kI=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,HT=RegExp(`${kI.source}${J6}`),NI=RegExp(`(?:[Tt]${HT.source})?`),W6=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Z6=/(\d{4})-?W(\d\d)(?:-?(\d))?/,K6=/(\d{4})-?(\d{3})/,X6=qT("weekYear","weekNumber","weekDay"),eK=qT("year","ordinal"),tK=/(\d{4})-(\d\d)-(\d\d)/,GT=RegExp(`${kI.source} ?(?:${zT.source}|(${jT.source}))?`),rK=RegExp(`(?: ${GT.source})?`);function _c(t,e,r){let n=t[e];return he(n)?r:ns(n)}function nK(t,e){return[{year:_c(t,e),month:_c(t,e+1,1),day:_c(t,e+2,1)},null,e+3]}function Nc(t,e){return[{hours:_c(t,e,0),minutes:_c(t,e+1,0),seconds:_c(t,e+2,0),milliseconds:TI(t[e+3])},null,e+4]}function Rl(t,e){let r=!t[e]&&!t[e+1],n=Pp(t[e+1],t[e+2]),i=r?null:kr.instance(n);return[{},i,e+3]}function kl(t,e){let r=t[e]?wo.create(t[e]):null;return[{},r,e+1]}var iK=RegExp(`^T?${kI.source}$`),oK=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function sK(t){let[e,r,n,i,o,s,a,c,u]=t,l=e[0]==="-",d=c&&c[0]==="-",A=(p,h=!1)=>p!==void 0&&(h||p&&l)?-p:p;return[{years:A(sa(r)),months:A(sa(n)),weeks:A(sa(i)),days:A(sa(o)),hours:A(sa(s)),minutes:A(sa(a)),seconds:A(sa(c),c==="-0"),milliseconds:A(TI(u),d)}]}var aK={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function OI(t,e,r,n,i,o,s){let a={year:e.length===2?BI(ns(e)):ns(e),month:UT.indexOf(r)+1,day:ns(n),hour:ns(i),minute:ns(o)};return s&&(a.second=ns(s)),t&&(a.weekday=t.length>3?xT.indexOf(t)+1:LT.indexOf(t)+1),a}var cK=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function uK(t){let[,e,r,n,i,o,s,a,c,u,l,d]=t,A=OI(e,i,n,r,o,s,a),p;return c?p=aK[c]:u?p=0:p=Pp(l,d),[A,new kr(p)]}function lK(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var dK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,AK=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,pK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zD(t){let[,e,r,n,i,o,s,a]=t;return[OI(e,i,n,r,o,s,a),kr.utcInstance]}function fK(t){let[,e,r,n,i,o,s,a]=t;return[OI(e,a,r,n,i,o,s),kr.utcInstance]}var hK=Tc(W6,NI),gK=Tc(Z6,NI),mK=Tc(K6,NI),yK=Tc(HT),YT=Rc(nK,Nc,Rl,kl),EK=Rc(X6,Nc,Rl,kl),IK=Rc(eK,Nc,Rl,kl),CK=Rc(Nc,Rl,kl);function bK(t){return kc(t,[hK,YT],[gK,EK],[mK,IK],[yK,CK])}function SK(t){return kc(lK(t),[cK,uK])}function wK(t){return kc(t,[dK,zD],[AK,zD],[pK,fK])}function BK(t){return kc(t,[oK,sK])}var QK=Rc(Nc);function vK(t){return kc(t,[iK,QK])}var _K=Tc(tK,rK),DK=Tc(GT),TK=Rc(Nc,Rl,kl);function RK(t){return kc(t,[_K,YT],[DK,TK])}var HD="Invalid Duration",VT={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},kK={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...VT},en=146097/400,wc=146097/4800,NK={years:{quarters:4,months:12,weeks:en/7,days:en,hours:en*24,minutes:en*24*60,seconds:en*24*60*60,milliseconds:en*24*60*60*1e3},quarters:{months:3,weeks:en/28,days:en/4,hours:en*24/4,minutes:en*24*60/4,seconds:en*24*60*60/4,milliseconds:en*24*60*60*1e3/4},months:{weeks:wc/7,days:wc,hours:wc*24,minutes:wc*24*60,seconds:wc*24*60*60,milliseconds:wc*24*60*60*1e3},...VT},ca=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],OK=ca.slice(0).reverse();function bo(t,e,r=!1){let n={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Bt(n)}function JT(t,e){var r;let n=(r=e.milliseconds)!=null?r:0;for(let i of OK.slice(1))e[i]&&(n+=e[i]*t[i].milliseconds);return n}function GD(t,e){let r=JT(t,e)<0?-1:1;ca.reduceRight((n,i)=>{if(he(e[i]))return n;if(n){let o=e[n]*r,s=t[i][n],a=Math.floor(o/s);e[i]+=a*r,e[n]-=a*s*r}return i},null),ca.reduce((n,i)=>{if(he(e[i]))return n;if(n){let o=e[n]%1;e[n]-=o,e[i]+=o*t[n][i]}return i},null)}function YD(t){let e={};for(let[r,n]of Object.entries(t))n!==0&&(e[r]=n);return e}var Bt=class t{constructor(e){let r=e.conversionAccuracy==="longterm"||!1,n=r?NK:kK;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||Ve.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,r){return t.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new Tt(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:Up(e,t.normalizeUnit),loc:Ve.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(ss(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new Tt(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){let[n]=BK(e);return n?t.fromObject(n,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){let[n]=vK(e);return n?t.fromObject(n,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new Tt("need to specify a reason the Duration is invalid");let n=e instanceof Tr?e:new Tr(e,r);if(We.throwOnInvalid)throw new AI(n);return new t({invalid:n})}static normalizeUnit(e){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new Tp(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Dr.create(this.loc,n).formatDurationFromString(this,e):HD}toHuman(e={}){if(!this.isValid)return HD;let r=e.showZeros!==!1,n=ca.map(i=>{let o=this.values[i];return he(o)||o===0&&!r?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(o)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=RI(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},tt.fromMillis(r,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?JT(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e),n={};for(let i of ca)(Dc(r.values,i)||Dc(this.values,i))&&(n[i]=r.get(i)+this.get(i));return bo(this,{values:n},!0)}minus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=OT(e(this.values[n],n));return bo(this,{values:r},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let r={...this.values,...Up(e,t.normalizeUnit)};return bo(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let s={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:i,conversionAccuracy:n};return bo(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return GD(this.matrix,e),bo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=YD(this.normalize().shiftToAll().toObject());return bo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>t.normalizeUnit(s));let r={},n={},i=this.toObject(),o;for(let s of ca)if(e.indexOf(s)>=0){o=s;let a=0;for(let u in n)a+=this.matrix[u][s]*n[u],n[u]=0;ss(i[s])&&(a+=i[s]);let c=Math.trunc(a);r[s]=c,n[s]=(a*1e3-c*1e3)/1e3}else ss(i[s])&&(n[s]=i[s]);for(let s in n)n[s]!==0&&(r[o]+=s===o?n[s]:n[s]/this.matrix[o][s]);return GD(this.matrix,r),bo(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return bo(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=YD(this.values);return bo(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of ca)if(!r(this.values[n],e.values[n]))return!1;return!0}},Bc="Invalid Interval";function UK(t,e){return!t||!t.isValid?la.invalid("missing or invalid start"):!e||!e.isValid?la.invalid("missing or invalid end"):e<t?la.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var la=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new Tt("need to specify a reason the Interval is invalid");let n=e instanceof Tr?e:new Tr(e,r);if(We.throwOnInvalid)throw new dI(n);return new t({invalid:n})}static fromDateTimes(e,r){let n=Sl(e),i=Sl(r),o=UK(n,i);return o??new t({start:n,end:i})}static after(e,r){let n=Bt.fromDurationLike(r),i=Sl(e);return t.fromDateTimes(i,i.plus(n))}static before(e,r){let n=Bt.fromDurationLike(r),i=Sl(e);return t.fromDateTimes(i.minus(n),i)}static fromISO(e,r){let[n,i]=(e||"").split("/",2);if(n&&i){let o,s;try{o=tt.fromISO(n,r),s=o.isValid}catch{s=!1}let a,c;try{a=tt.fromISO(i,r),c=a.isValid}catch{c=!1}if(s&&c)return t.fromDateTimes(o,a);if(s){let u=Bt.fromISO(i,r);if(u.isValid)return t.after(o,u)}else if(c){let u=Bt.fromISO(n,r);if(u.isValid)return t.before(a,u)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",r){if(!this.isValid)return NaN;let n=this.start.startOf(e,r),i;return r!=null&&r.useLocaleWeeks?i=this.end.reconfigure({locale:n.locale}):i=this.end,i=i.startOf(e,r),Math.floor(i.diff(n,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?t.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];let r=e.map(Sl).filter(s=>this.contains(s)).sort((s,a)=>s.toMillis()-a.toMillis()),n=[],{s:i}=this,o=0;for(;i<this.e;){let s=r[o]||this.e,a=+s>+this.e?this.e:s;n.push(t.fromDateTimes(i,a)),i=a,o+=1}return n}splitBy(e){let r=Bt.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,o,s=[];for(;n<this.e;){let a=this.start.plus(r.mapUnits(c=>c*i));o=+a>+this.e?this.e:a,s.push(t.fromDateTimes(n,o)),n=o,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let r=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return r>=n?null:t.fromDateTimes(r,n)}union(e){if(!this.isValid)return this;let r=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return t.fromDateTimes(r,n)}static merge(e){let[r,n]=e.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return n&&r.push(n),r}static xor(e){let r=null,n=0,i=[],o=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((c,u)=>c.time-u.time);for(let c of a)n+=c.type==="s"?1:-1,n===1?r=c.time:(r&&+r!=+c.time&&i.push(t.fromDateTimes(r,c.time)),r=null);return t.merge(i)}difference(...e){return t.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Bc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Rp,r={}){return this.isValid?Dr.create(this.s.loc.clone(r),e).formatInterval(this):Bc}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Bc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Bc}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Bc}toFormat(e,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:Bc}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):Bt.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},ua=class{static hasDST(e=We.defaultZone){let r=tt.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return wo.isValidZone(e)}static normalizeZone(e){return is(e,We.defaultZone)}static getStartOfWeek({locale:e=null,locObj:r=null}={}){return(r||Ve.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:r=null}={}){return(r||Ve.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:r=null}={}){return(r||Ve.create(e)).getWeekendDays().slice()}static months(e="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Ve.create(r,n,o)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Ve.create(r,n,o)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Ve.create(r,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Ve.create(r,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ve.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return Ve.create(r,null,"gregory").eras(e)}static features(){return{relative:RT(),localeWeek:kT()}}};function VD(t,e){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(e)-r(t);return Math.floor(Bt.fromMillis(n).as("days"))}function MK(t,e,r){let n=[["years",(c,u)=>u.year-c.year],["quarters",(c,u)=>u.quarter-c.quarter+(u.year-c.year)*4],["months",(c,u)=>u.month-c.month+(u.year-c.year)*12],["weeks",(c,u)=>{let l=VD(c,u);return(l-l%7)/7}],["days",VD]],i={},o=t,s,a;for(let[c,u]of n)r.indexOf(c)>=0&&(s=c,i[c]=u(t,e),a=o.plus(i),a>e?(i[c]--,t=o.plus(i),t>e&&(a=t,i[c]--,t=o.plus(i))):t=a);return[t,i,a,s]}function xK(t,e,r,n){let[i,o,s,a]=MK(t,e,r),c=e-i,u=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(s<e&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+c/(s-i)));let l=Bt.fromObject(o,n);return u.length>0?Bt.fromMillis(c,n).shiftTo(...u).plus(l):l}var LK="missing Intl.DateTimeFormat.formatToParts support";function Ue(t,e=r=>r){return{regex:t,deser:([r])=>e(_6(r))}}var PK="\xA0",WT=`[ ${PK}]`,ZT=new RegExp(WT,"g");function FK(t){return t.replace(/\./g,"\\.?").replace(ZT,WT)}function JD(t){return t.replace(/\./g,"").replace(ZT," ").toLowerCase()}function On(t,e){return t===null?null:{regex:RegExp(t.map(FK).join("|")),deser:([r])=>t.findIndex(n=>JD(r)===JD(n))+e}}function WD(t,e){return{regex:t,deser:([,r,n])=>Pp(r,n),groups:e}}function wp(t){return{regex:t,deser:([e])=>e}}function $K(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function jK(t,e){let r=Nn(e),n=Nn(e,"{2}"),i=Nn(e,"{3}"),o=Nn(e,"{4}"),s=Nn(e,"{6}"),a=Nn(e,"{1,2}"),c=Nn(e,"{1,3}"),u=Nn(e,"{1,6}"),l=Nn(e,"{1,9}"),d=Nn(e,"{2,4}"),A=Nn(e,"{4,6}"),p=S=>({regex:RegExp($K(S.val)),deser:([B])=>B,literal:!0}),g=(S=>{if(t.literal)return p(S);switch(S.val){case"G":return On(e.eras("short"),0);case"GG":return On(e.eras("long"),0);case"y":return Ue(u);case"yy":return Ue(d,BI);case"yyyy":return Ue(o);case"yyyyy":return Ue(A);case"yyyyyy":return Ue(s);case"M":return Ue(a);case"MM":return Ue(n);case"MMM":return On(e.months("short",!0),1);case"MMMM":return On(e.months("long",!0),1);case"L":return Ue(a);case"LL":return Ue(n);case"LLL":return On(e.months("short",!1),1);case"LLLL":return On(e.months("long",!1),1);case"d":return Ue(a);case"dd":return Ue(n);case"o":return Ue(c);case"ooo":return Ue(i);case"HH":return Ue(n);case"H":return Ue(a);case"hh":return Ue(n);case"h":return Ue(a);case"mm":return Ue(n);case"m":return Ue(a);case"q":return Ue(a);case"qq":return Ue(n);case"s":return Ue(a);case"ss":return Ue(n);case"S":return Ue(c);case"SSS":return Ue(i);case"u":return wp(l);case"uu":return wp(a);case"uuu":return Ue(r);case"a":return On(e.meridiems(),0);case"kkkk":return Ue(o);case"kk":return Ue(d,BI);case"W":return Ue(a);case"WW":return Ue(n);case"E":case"c":return Ue(r);case"EEE":return On(e.weekdays("short",!1),1);case"EEEE":return On(e.weekdays("long",!1),1);case"ccc":return On(e.weekdays("short",!0),1);case"cccc":return On(e.weekdays("long",!0),1);case"Z":case"ZZ":return WD(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return WD(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return wp(/[a-z_+-/]{1,256}?/i);case" ":return wp(/[^\S\n\r]/);default:return p(S)}})(t)||{invalidReason:LK};return g.token=t,g}var qK={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function zK(t,e,r){let{type:n,value:i}=t;if(n==="literal"){let c=/^\s+$/.test(i);return{literal:!c,val:c?" ":i}}let o=e[n],s=n;n==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=r.hour12?"hour12":"hour24");let a=qK[s];if(typeof a=="object"&&(a=a[o]),a)return{literal:!1,val:a}}function HK(t){return[`^${t.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,t]}function GK(t,e,r){let n=t.match(e);if(n){let i={},o=1;for(let s in r)if(Dc(r,s)){let a=r[s],c=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(n.slice(o,o+c))),o+=c}return[n,i]}else return[n,{}]}function YK(t){let e=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return he(t.z)||(r=wo.create(t.z)),he(t.Z)||(r||(r=new kr(t.Z)),n=t.Z),he(t.q)||(t.M=(t.q-1)*3+1),he(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),he(t.u)||(t.S=TI(t.u)),[Object.keys(t).reduce((o,s)=>{let a=e(s);return a&&(o[a]=t[s]),o},{}),r,n]}var oI=null;function VK(){return oI||(oI=tt.fromMillis(1555555555555)),oI}function JK(t,e){if(t.literal)return t;let r=Dr.macroTokenToFormatOpts(t.val),n=eR(r,e);return n==null||n.includes(void 0)?t:n}function KT(t,e){return Array.prototype.concat(...t.map(r=>JK(r,e)))}var Mp=class{constructor(e,r){if(this.locale=e,this.format=r,this.tokens=KT(Dr.parseFormat(r),e),this.units=this.tokens.map(n=>jK(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){let[n,i]=HK(this.units);this.regex=RegExp(n,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){let[r,n]=GK(e,this.regex,this.handlers),[i,o,s]=n?YK(n):[null,null,void 0];if(Dc(n,"a")&&Dc(n,"H"))throw new os("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:n,result:i,zone:o,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function XT(t,e,r){return new Mp(t,r).explainFromTokens(e)}function WK(t,e,r){let{result:n,zone:i,specificOffset:o,invalidReason:s}=XT(t,e,r);return[n,i,o,s]}function eR(t,e){if(!t)return null;let n=Dr.create(e,t).dtFormatter(VK()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(s=>zK(s,t,o))}var sI="Invalid DateTime",ZD=864e13;function Bl(t){return new Tr("unsupported zone",`the zone "${t.name}" is not supported`)}function aI(t){return t.weekData===null&&(t.weekData=Np(t.c)),t.weekData}function cI(t){return t.localWeekData===null&&(t.localWeekData=Np(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function aa(t,e){let r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new tt({...r,...e,old:r})}function tR(t,e,r){let n=t-e*60*1e3,i=r.offset(n);if(e===i)return[n,e];n-=(i-e)*60*1e3;let o=r.offset(n);return i===o?[n,i]:[t-Math.min(i,o)*60*1e3,Math.max(i,o)]}function Bp(t,e){t+=e*60*1e3;let r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function vp(t,e,r){return tR(Lp(t),e,r)}function KD(t,e){let r=t.o,n=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,o={...t.c,year:n,month:i,day:Math.min(t.c.day,Op(n,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Bt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=Lp(o),[c,u]=tR(a,r,t.zone);return s!==0&&(c+=s,u=t.zone.offset(c)),{ts:c,o:u}}function Qc(t,e,r,n,i,o){let{setZone:s,zone:a}=r;if(t&&Object.keys(t).length!==0||e){let c=e||a,u=tt.fromObject(t,{...r,zone:c,specificOffset:o});return s?u:u.setZone(a)}else return tt.invalid(new Tr("unparsable",`the input "${i}" can't be parsed as ${n}`))}function Qp(t,e,r=!0){return t.isValid?Dr.create(Ve.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function uI(t,e,r){let n=t.c.year>9999||t.c.year<0,i="";if(n&&t.c.year>=0&&(i+="+"),i+=Et(t.c.year,n?6:4),r==="year")return i;if(e){if(i+="-",i+=Et(t.c.month),r==="month")return i;i+="-"}else if(i+=Et(t.c.month),r==="month")return i;return i+=Et(t.c.day),i}function XD(t,e,r,n,i,o,s){let a=!r||t.c.millisecond!==0||t.c.second!==0,c="";switch(s){case"day":case"month":case"year":break;default:if(c+=Et(t.c.hour),s==="hour")break;if(e){if(c+=":",c+=Et(t.c.minute),s==="minute")break;a&&(c+=":",c+=Et(t.c.second))}else{if(c+=Et(t.c.minute),s==="minute")break;a&&(c+=Et(t.c.second))}if(s==="second")break;a&&(!n||t.c.millisecond!==0)&&(c+=".",c+=Et(t.c.millisecond,3))}return i&&(t.isOffsetFixed&&t.offset===0&&!o?c+="Z":t.o<0?(c+="-",c+=Et(Math.trunc(-t.o/60)),c+=":",c+=Et(Math.trunc(-t.o%60))):(c+="+",c+=Et(Math.trunc(t.o/60)),c+=":",c+=Et(Math.trunc(t.o%60)))),o&&(c+="["+t.zone.ianaName+"]"),c}var rR={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ZK={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},KK={ordinal:1,hour:0,minute:0,second:0,millisecond:0},_p=["year","month","day","hour","minute","second","millisecond"],XK=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],e3=["year","ordinal","hour","minute","second","millisecond"];function Dp(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Tp(t);return e}function eT(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Dp(t)}}function t3(t){if(Ql===void 0&&(Ql=We.now()),t.type!=="iana")return t.offset(Ql);let e=t.name,r=QI.get(e);return r===void 0&&(r=t.offset(Ql),QI.set(e,r)),r}function tT(t,e){let r=is(e.zone,We.defaultZone);if(!r.isValid)return tt.invalid(Bl(r));let n=Ve.fromObject(e),i,o;if(he(t.year))i=We.now();else{for(let c of _p)he(t[c])&&(t[c]=rR[c]);let s=DT(t)||TT(t);if(s)return tt.invalid(s);let a=t3(r);[i,o]=vp(t,a,r)}return new tt({ts:i,zone:r,loc:n,o})}function rT(t,e,r){let n=he(r.round)?!0:r.round,i=he(r.rounding)?"trunc":r.rounding,o=(a,c)=>(a=RI(a,n||r.calendary?0:2,r.calendary?"round":i),e.loc.clone(r).relFormatter(r).format(a,c)),s=a=>r.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(r.unit)return o(s(r.unit),r.unit);for(let a of r.units){let c=s(a);if(Math.abs(c)>=1)return o(c,a)}return o(t>e?-0:0,r.units[r.units.length-1])}function nT(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}var Ql,QI=new Map,tt=class t{constructor(e){let r=e.zone||We.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new Tr("invalid input"):null)||(r.isValid?null:Bl(r));this.ts=he(e.ts)?We.now():e.ts;let i=null,o=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[i,o]=[e.old.c,e.old.o];else{let a=ss(e.o)&&!e.old?e.o:r.offset(this.ts);i=Bp(this.ts,a),n=Number.isNaN(i.year)?new Tr("invalid input"):null,i=n?null:i,o=n?null:a}this._zone=r,this.loc=e.loc||Ve.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,r]=nT(arguments),[n,i,o,s,a,c,u]=r;return tT({year:n,month:i,day:o,hour:s,minute:a,second:c,millisecond:u},e)}static utc(){let[e,r]=nT(arguments),[n,i,o,s,a,c,u]=r;return e.zone=kr.utcInstance,tT({year:n,month:i,day:o,hour:s,minute:a,second:c,millisecond:u},e)}static fromJSDate(e,r={}){let n=N6(e)?e.valueOf():NaN;if(Number.isNaN(n))return t.invalid("invalid input");let i=is(r.zone,We.defaultZone);return i.isValid?new t({ts:n,zone:i,loc:Ve.fromObject(r)}):t.invalid(Bl(i))}static fromMillis(e,r={}){if(ss(e))return e<-ZD||e>ZD?t.invalid("Timestamp out of range"):new t({ts:e,zone:is(r.zone,We.defaultZone),loc:Ve.fromObject(r)});throw new Tt(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(ss(e))return new t({ts:e*1e3,zone:is(r.zone,We.defaultZone),loc:Ve.fromObject(r)});throw new Tt("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};let n=is(r.zone,We.defaultZone);if(!n.isValid)return t.invalid(Bl(n));let i=Ve.fromObject(r),o=Up(e,eT),{minDaysInFirstWeek:s,startOfWeek:a}=FD(o,i),c=We.now(),u=he(r.specificOffset)?n.offset(c):r.specificOffset,l=!he(o.ordinal),d=!he(o.year),A=!he(o.month)||!he(o.day),p=d||A,h=o.weekYear||o.weekNumber;if((p||l)&&h)throw new os("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(A&&l)throw new os("Can't mix ordinal dates with month/day");let g=h||o.weekday&&!p,S,B,v=Bp(c,u);g?(S=XK,B=ZK,v=Np(v,s,a)):l?(S=e3,B=KK,v=iI(v)):(S=_p,B=rR);let Q=!1;for(let me of S){let Ae=o[me];he(Ae)?Q?o[me]=B[me]:o[me]=v[me]:Q=!0}let k=g?T6(o,s,a):l?R6(o):DT(o),M=k||TT(o);if(M)return t.invalid(M);let Y=g?LD(o,s,a):l?PD(o):o,[_e,Z]=vp(Y,u,n),$=new t({ts:_e,zone:n,o:Z,loc:i});return o.weekday&&p&&e.weekday!==$.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${$.toISO()}`):$.isValid?$:t.invalid($.invalid)}static fromISO(e,r={}){let[n,i]=bK(e);return Qc(n,i,r,"ISO 8601",e)}static fromRFC2822(e,r={}){let[n,i]=SK(e);return Qc(n,i,r,"RFC 2822",e)}static fromHTTP(e,r={}){let[n,i]=wK(e);return Qc(n,i,r,"HTTP",r)}static fromFormat(e,r,n={}){if(he(e)||he(r))throw new Tt("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=n,s=Ve.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,c,u,l]=WK(s,e,r);return l?t.invalid(l):Qc(a,c,n,`format ${r}`,e,u)}static fromString(e,r,n={}){return t.fromFormat(e,r,n)}static fromSQL(e,r={}){let[n,i]=RK(e);return Qc(n,i,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new Tt("need to specify a reason the DateTime is invalid");let n=e instanceof Tr?e:new Tr(e,r);if(We.throwOnInvalid)throw new lI(n);return new t({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){let n=eR(e,Ve.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(e,r={}){return KT(Dr.parseFormat(e),Ve.fromObject(r)).map(i=>i.val).join("")}static resetCache(){Ql=void 0,QI.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?aI(this).weekYear:NaN}get weekNumber(){return this.isValid?aI(this).weekNumber:NaN}get weekday(){return this.isValid?aI(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cI(this).weekday:NaN}get localWeekNumber(){return this.isValid?cI(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cI(this).weekYear:NaN}get ordinal(){return this.isValid?iI(this.c).ordinal:NaN}get monthShort(){return this.isValid?ua.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ua.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ua.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ua.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,r=6e4,n=Lp(this.c),i=this.zone.offset(n-e),o=this.zone.offset(n+e),s=this.zone.offset(n-i*r),a=this.zone.offset(n-o*r);if(s===a)return[this];let c=n-s*r,u=n-a*r,l=Bp(c,s),d=Bp(u,a);return l.hour===d.hour&&l.minute===d.minute&&l.second===d.second&&l.millisecond===d.millisecond?[aa(this,{ts:c}),aa(this,{ts:u})]:[this]}get isInLeapYear(){return Tl(this.year)}get daysInMonth(){return Op(this.year,this.month)}get daysInYear(){return this.isValid?vc(this.year):NaN}get weeksInWeekYear(){return this.isValid?Dl(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Dl(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:r,numberingSystem:n,calendar:i}=Dr.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(e=0,r={}){return this.setZone(kr.instance(e),r)}toLocal(){return this.setZone(We.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(e=is(e,We.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(r||n){let o=e.offset(this.ts),s=this.toObject();[i]=vp(s,o,e)}return aa(this,{ts:i,zone:e})}else return t.invalid(Bl(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:n});return aa(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let r=Up(e,eT),{minDaysInFirstWeek:n,startOfWeek:i}=FD(r,this.loc),o=!he(r.weekYear)||!he(r.weekNumber)||!he(r.weekday),s=!he(r.ordinal),a=!he(r.year),c=!he(r.month)||!he(r.day),u=a||c,l=r.weekYear||r.weekNumber;if((u||s)&&l)throw new os("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&s)throw new os("Can't mix ordinal dates with month/day");let d;o?d=LD({...Np(this.c,n,i),...r},n,i):he(r.ordinal)?(d={...this.toObject(),...r},he(r.day)&&(d.day=Math.min(Op(d.year,d.month),d.day))):d=PD({...iI(this.c),...r});let[A,p]=vp(d,this.o,this.zone);return aa(this,{ts:A,o:p})}plus(e){if(!this.isValid)return this;let r=Bt.fromDurationLike(e);return aa(this,KD(this,r))}minus(e){if(!this.isValid)return this;let r=Bt.fromDurationLike(e).negate();return aa(this,KD(this,r))}startOf(e,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let n={},i=Bt.normalizeUnit(e);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(i==="weeks")if(r){let o=this.loc.getStartOfWeek(),{weekday:s}=this;s<o&&(n.weekNumber=this.weekNumber-1),n.weekday=o}else n.weekday=1;if(i==="quarters"){let o=Math.ceil(this.month/3);n.month=(o-1)*3+1}return this.set(n)}endOf(e,r){return this.isValid?this.plus({[e]:1}).startOf(e,r).minus(1):this}toFormat(e,r={}){return this.isValid?Dr.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):sI}toLocaleString(e=Rp,r={}){return this.isValid?Dr.create(this.loc.clone(r),e).formatDateTime(this):sI}toLocaleParts(e={}){return this.isValid?Dr.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:o=!1,precision:s="milliseconds"}={}){if(!this.isValid)return null;s=Dp(s);let a=e==="extended",c=uI(this,a,s);return _p.indexOf(s)>=3&&(c+="T"),c+=XD(this,a,r,n,i,o,s),c}toISODate({format:e="extended",precision:r="day"}={}){return this.isValid?uI(this,e==="extended",Dp(r)):null}toISOWeekDate(){return Qp(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended",precision:a="milliseconds"}={}){return this.isValid?(a=Dp(a),(i&&_p.indexOf(a)>=3?"T":"")+XD(this,s==="extended",r,e,n,o,a)):null}toRFC2822(){return Qp(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Qp(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?uI(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(r||e)&&(n&&(i+=" "),r?i+="z":e&&(i+="ZZ")),Qp(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():sI}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",n={}){if(!this.isValid||!e.isValid)return Bt.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...n},o=O6(r).map(Bt.normalizeUnit),s=e.valueOf()>this.valueOf(),a=s?this:e,c=s?e:this,u=xK(a,c,o,i);return s?u.negate():u}diffNow(e="milliseconds",r={}){return this.diff(t.now(),e,r)}until(e){return this.isValid?la.fromDateTimes(this,e):this}hasSame(e,r,n){if(!this.isValid)return!1;let i=e.valueOf(),o=this.setZone(e.zone,{keepLocalTime:!0});return o.startOf(r,n)<=i&&i<=o.endOf(r,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let r=e.base||t.fromObject({},{zone:this.zone}),n=e.padding?this<r?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),rT(r,this.plus(n),{...e,numeric:"always",units:i,unit:o})}toRelativeCalendar(e={}){return this.isValid?rT(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new Tt("min requires all arguments be DateTimes");return $D(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new Tt("max requires all arguments be DateTimes");return $D(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,n={}){let{locale:i=null,numberingSystem:o=null}=n,s=Ve.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return XT(s,e,r)}static fromStringExplain(e,r,n={}){return t.fromFormatExplain(e,r,n)}static buildFormatParser(e,r={}){let{locale:n=null,numberingSystem:i=null}=r,o=Ve.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return new Mp(o,e)}static fromFormatParser(e,r,n={}){if(he(e)||he(r))throw new Tt("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:o=null}=n,s=Ve.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});if(!s.equals(r.locale))throw new Tt(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${r.locale}`);let{result:a,zone:c,specificOffset:u,invalidReason:l}=r.explainFromTokens(e);return l?t.invalid(l):Qc(a,c,n,`format ${r.format}`,e,u)}static get DATE_SHORT(){return Rp}static get DATE_MED(){return iT}static get DATE_MED_WITH_WEEKDAY(){return d6}static get DATE_FULL(){return oT}static get DATE_HUGE(){return sT}static get TIME_SIMPLE(){return aT}static get TIME_WITH_SECONDS(){return cT}static get TIME_WITH_SHORT_OFFSET(){return uT}static get TIME_WITH_LONG_OFFSET(){return lT}static get TIME_24_SIMPLE(){return dT}static get TIME_24_WITH_SECONDS(){return AT}static get TIME_24_WITH_SHORT_OFFSET(){return pT}static get TIME_24_WITH_LONG_OFFSET(){return fT}static get DATETIME_SHORT(){return hT}static get DATETIME_SHORT_WITH_SECONDS(){return gT}static get DATETIME_MED(){return mT}static get DATETIME_MED_WITH_SECONDS(){return yT}static get DATETIME_MED_WITH_WEEKDAY(){return A6}static get DATETIME_FULL(){return ET}static get DATETIME_FULL_WITH_SECONDS(){return IT}static get DATETIME_HUGE(){return CT}static get DATETIME_HUGE_WITH_SECONDS(){return bT}};function Sl(t){if(tt.isDateTime(t))return t;if(t&&t.valueOf&&ss(t.valueOf()))return tt.fromJSDate(t);if(t&&typeof t=="object")return tt.fromObject(t);throw new Tt(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var r3="3.7.2";Nr.DateTime=tt;Nr.Duration=Bt;Nr.FixedOffsetZone=kr;Nr.IANAZone=wo;Nr.Info=ua;Nr.Interval=la;Nr.InvalidZone=kp;Nr.Settings=We;Nr.SystemZone=_l;Nr.VERSION=r3;Nr.Zone=as});var qp=m(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.CronDate=tr.DAYS_IN_MONTH=tr.DateMathOp=tr.TimeUnit=void 0;var da=nR(),jt;(function(t){t.Second="Second",t.Minute="Minute",t.Hour="Hour",t.Day="Day",t.Month="Month",t.Year="Year"})(jt||(tr.TimeUnit=jt={}));var $p;(function(t){t.Add="Add",t.Subtract="Subtract"})($p||(tr.DateMathOp=$p={}));tr.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var jp=class t{#e;#t=null;#n=null;#i={add:{[jt.Year]:this.addYear.bind(this),[jt.Month]:this.addMonth.bind(this),[jt.Day]:this.addDay.bind(this),[jt.Hour]:this.addHour.bind(this),[jt.Minute]:this.addMinute.bind(this),[jt.Second]:this.addSecond.bind(this)},subtract:{[jt.Year]:this.subtractYear.bind(this),[jt.Month]:this.subtractMonth.bind(this),[jt.Day]:this.subtractDay.bind(this),[jt.Hour]:this.subtractHour.bind(this),[jt.Minute]:this.subtractMinute.bind(this),[jt.Second]:this.subtractSecond.bind(this)}};constructor(e,r){let n={zone:r};if(e?e instanceof t?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n):e instanceof Date?this.#e=da.DateTime.fromJSDate(e,n):typeof e=="number"?this.#e=da.DateTime.fromMillis(e,n):(this.#e=da.DateTime.fromISO(e,n),this.#e.isValid||(this.#e=da.DateTime.fromRFC2822(e,n)),this.#e.isValid||(this.#e=da.DateTime.fromSQL(e,n)),this.#e.isValid||(this.#e=da.DateTime.fromFormat(e,"EEE, d MMM yyyy HH:mm:ss",n))):this.#e=da.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${e}`);r&&r!==this.#e.zoneName&&(this.#e=this.#e.setZone(r))}static#o(e){return e%4===0&&e%100!==0||e%400===0}get dstStart(){return this.#t}set dstStart(e){this.#t=e}get dstEnd(){return this.#n}set dstEnd(e){this.#n=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){this.#i.add[e]()}subtractUnit(e){this.#i.subtract[e]()}invokeDateOperation(e,r){if(e===$p.Add){this.addUnit(r);return}if(e===$p.Subtract){this.subtractUnit(r);return}throw new Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){let e=this.#r().weekday;return e===7?0:e}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:e,month:r}=this.#e;if(r===2){let n=t.#o(this.#e.year);return e===tr.DAYS_IN_MONTH[r-1]-(n?0:1)}return e===tr.DAYS_IN_MONTH[r-1]}isLastWeekdayOfMonth(){let{day:e,month:r}=this.#e,n;return r===2?n=tr.DAYS_IN_MONTH[r-1]-(t.#o(this.#e.year)?0:1):n=tr.DAYS_IN_MONTH[r-1],e>n-7}applyDateOperation(e,r,n){if(r===jt.Month||r===jt.Day){this.invokeDateOperation(e,r);return}let i=this.getHours();this.invokeDateOperation(e,r);let o=this.getHours(),s=o-i;s===2?n!==24&&(this.dstStart=o):s===0&&this.getMinutes()===0&&this.getSeconds()===0&&n!==24&&(this.dstEnd=o)}#r(){return this.#e.toUTC()}};tr.CronDate=jp;tr.default=jp});var iR=m(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.CronMonth=void 0;var n3=qp(),i3=rs(),o3=1,s3=12,a3=Object.freeze([]),UI=class extends i3.CronField{static get min(){return o3}static get max(){return s3}static get chars(){return a3}static get daysInMonth(){return n3.DAYS_IN_MONTH}constructor(e,r){super(e,r),this.validate()}get values(){return super.values}};zp.CronMonth=UI});var oR=m(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.CronSecond=void 0;var c3=rs(),u3=0,l3=59,d3=Object.freeze([]),MI=class extends c3.CronField{static get min(){return u3}static get max(){return l3}static get chars(){return d3}constructor(e,r){super(e,r),this.validate()}get values(){return super.values}};Hp.CronSecond=MI});var Gp=m(Ar=>{"use strict";var A3=Ar&&Ar.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cs=Ar&&Ar.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A3(e,t,r)};Object.defineProperty(Ar,"__esModule",{value:!0});cs(SD(),Ar);cs(wD(),Ar);cs(BD(),Ar);cs(rs(),Ar);cs(QD(),Ar);cs(vD(),Ar);cs(iR(),Ar);cs(oR(),Ar)});var LI=m(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.CronFieldCollection=void 0;var nn=Gp(),xI=class t{#e;#t;#n;#i;#o;#r;static from(e,r){return new t({second:this.resolveField(nn.CronSecond,e.second,r.second),minute:this.resolveField(nn.CronMinute,e.minute,r.minute),hour:this.resolveField(nn.CronHour,e.hour,r.hour),dayOfMonth:this.resolveField(nn.CronDayOfMonth,e.dayOfMonth,r.dayOfMonth),month:this.resolveField(nn.CronMonth,e.month,r.month),dayOfWeek:this.resolveField(nn.CronDayOfWeek,e.dayOfWeek,r.dayOfWeek)})}static resolveField(e,r,n){return n?n instanceof nn.CronField?n:new e(n):r}constructor({second:e,minute:r,hour:n,dayOfMonth:i,month:o,dayOfWeek:s}){if(!e)throw new Error("Validation error, Field second is missing");if(!r)throw new Error("Validation error, Field minute is missing");if(!n)throw new Error("Validation error, Field hour is missing");if(!i)throw new Error("Validation error, Field dayOfMonth is missing");if(!o)throw new Error("Validation error, Field month is missing");if(!s)throw new Error("Validation error, Field dayOfWeek is missing");if(o.values.length===1&&!i.hasLastChar&&!(parseInt(i.values[0],10)<=nn.CronMonth.daysInMonth[o.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=e,this.#t=r,this.#n=n,this.#o=o,this.#r=s,this.#i=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#i}get month(){return this.#o}get dayOfWeek(){return this.#r}static compactField(e){if(e.length===0)return[];let r=[],n;return e.forEach((i,o,s)=>{if(n===void 0){n={start:i,count:1};return}let a=s[o-1]||n.start,c=s[o+1];if(i==="L"||i==="W"){r.push(n),r.push({start:i,count:1}),n=void 0;return}if(n.step===void 0&&c!==void 0){let u=i-a,l=c-i;if(u<=l){n={...n,count:2,end:i,step:u};return}n.step=1}i-(n.end??0)===n.step?(n.count++,n.end=i):(n.count===1?r.push({start:n.start,count:1}):n.count===2?(r.push({start:n.start,count:1}),r.push({start:n.end??a,count:1})):r.push(n),n={start:i,count:1})}),n&&r.push(n),r}static#c(e,r,n){let i=r.step;return i?i===1&&r.start===e.min&&r.end&&r.end>=n?e.hasQuestionMarkChar?"?":"*":i!==1&&r.start===e.min&&r.end&&r.end>=n-i+1?`*/${i}`:null:null}static#s(e,r){let n=e.step;if(n===1)return`${e.start}-${e.end}`;let i=e.start===0?e.count-1:e.count;if(!n)throw new Error("Unexpected range step");if(!e.end)throw new Error("Unexpected range end");if(n*i>e.end){let o=(a,c)=>{if(typeof e.start!="number")throw new Error("Unexpected range start");return c%n===0?e.start+c:null};if(typeof e.start!="number")throw new Error("Unexpected range start");let s={length:e.end-e.start+1};return Array.from(s,o).filter(a=>a!==null).join(",")}return e.end===r-n+1?`${e.start}/${n}`:`${e.start}-${e.end}/${n}`}stringifyField(e){let r=e.max,n=e.values;if(e instanceof nn.CronDayOfWeek){r=6;let o=this.#r.values;n=o[o.length-1]===7?o.slice(0,-1):o}e instanceof nn.CronDayOfMonth&&(r=this.#o.values.length===1?nn.CronMonth.daysInMonth[this.#o.values[0]-1]:e.max);let i=t.compactField(n);if(i.length===1){let o=t.#c(e,i[0],r);if(o)return o}return i.map(o=>{let s=o.count===1?o.start.toString():t.#s(o,r);return e instanceof nn.CronDayOfWeek&&e.nthDay>0?`${s}#${e.nthDay}`:s}).join(",")}stringify(e=!1){let r=[];return e&&r.push(this.stringifyField(this.#e)),r.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#i),this.stringifyField(this.#o),this.stringifyField(this.#r)),r.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#i.serialize(),month:this.#o.serialize(),dayOfWeek:this.#r.serialize()}}};Yp.CronFieldCollection=xI});var PI=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.CronExpression=on.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=on.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var ct=qp();on.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range";on.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";var sR=1e4,Vp=class t{#e;#t;#n;#i;#o;#r;#c=null;#s=!1;constructor(e,r){this.#e=r,this.#t=r.tz,this.#i=r.startDate?new ct.CronDate(r.startDate,this.#t):null,this.#o=r.endDate?new ct.CronDate(r.endDate,this.#t):null;let n=r.currentDate??r.startDate;if(n){let i=new ct.CronDate(n,this.#t);this.#i&&i.getTime()<this.#i.getTime()?n=this.#i:this.#o&&i.getTime()>this.#o.getTime()&&(n=this.#o)}this.#n=new ct.CronDate(n,this.#t),this.#r=e}get fields(){return this.#r}static fieldsToExpression(e,r){return new t(e,r||{})}static#a(e,r){return r.some(n=>n===e)}#u(e,r){return e[r?e.length-1:0]}#d(e){let r=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#c===r)return this.#s;let n=new ct.CronDate(e);n.setStartOfDay();let i=new ct.CronDate(e);return i.setEndOfDay(),this.#c=r,this.#s=n.getUTCOffset()!==i.getUTCOffset(),this.#s}#A(e,r,n){let i=this.#r.second.values,o=e.getSeconds(),s=this.#r.second.findNearestValue(o,n);if(s!==null){e.setSeconds(s);return}e.applyDateOperation(r,ct.TimeUnit.Minute,this.#r.hour.values.length),e.setSeconds(this.#u(i,n))}#p(e,r,n){let i=this.#r.minute.values,o=this.#r.second.values,s=e.getMinutes(),a=this.#r.minute.findNearestValue(s,n);if(a!==null){e.setMinutes(a),e.setSeconds(this.#u(o,n));return}e.applyDateOperation(r,ct.TimeUnit.Hour,this.#r.hour.values.length),e.setMinutes(this.#u(i,n)),e.setSeconds(this.#u(o,n))}static#f(e,r){let n=r.isLastWeekdayOfMonth();return e.some(i=>{let o=parseInt(i.toString().charAt(0),10)%7;if(Number.isNaN(o))throw new Error(`Invalid last weekday of the month expression: ${i}`);return r.getDay()===o&&n})}next(){return this.#g()}prev(){return this.#g(!0)}hasNext(){let e=this.#n;try{return this.#g(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#g(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let r=[];if(e>=0)for(let n=0;n<e;n++)try{r.push(this.next())}catch{return r}else for(let n=0;n>e;n--)try{r.push(this.prev())}catch{return r}return r}reset(e){this.#n=new ct.CronDate(e||this.#e.currentDate)}stringify(e=!1){return this.#r.stringify(e)}includesDate(e){let{second:r,minute:n,hour:i,month:o}=this.#r,s=new ct.CronDate(e,this.#t);return!(!r.values.includes(s.getSeconds())||!n.values.includes(s.getMinutes())||!i.values.includes(s.getHours())||!o.values.includes(s.getMonth()+1)||!this.#l(s)||this.#r.dayOfWeek.nthDay>0&&Math.ceil(s.getDate()/7)!==this.#r.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#l(e){let r=this.#r.dayOfMonth.isWildcard,n=!r,i=this.#r.dayOfWeek.isWildcard,o=!i,s=t.#a(e.getDate(),this.#r.dayOfMonth.values)||this.#r.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),a=t.#a(e.getDay(),this.#r.dayOfWeek.values)||this.#r.dayOfWeek.hasLastChar&&t.#f(this.#r.dayOfWeek.values,e);return!!(n&&o&&(s||a)||s&&!o||r&&!i&&a)}#m(e,r,n){let i=this.#r.hour.values,o=i,s=e.getHours(),a=t.#a(s,i),c=e.dstStart===s,u=e.dstEnd===s;if(c)return t.#a(s-1,i)?!0:(e.invokeDateOperation(r,ct.TimeUnit.Hour),!1);if(u&&!n)return e.dstEnd=null,e.applyDateOperation(ct.DateMathOp.Add,ct.TimeUnit.Hour,o.length),!1;if(a)return!0;e.dstStart=null;let l=this.#r.hour.findNearestValue(s,n);if(l===null)return e.applyDateOperation(r,ct.TimeUnit.Day,o.length),!1;if(this.#d(e)){let d=n?s-l:l-s;for(let A=0;A<d;A++)e.applyDateOperation(r,ct.TimeUnit.Hour,o.length)}else e.setHours(l);return e.setMinutes(this.#u(this.#r.minute.values,n)),e.setSeconds(this.#u(this.#r.second.values,n)),!1}#h(e){if(!this.#i&&!this.#o)return;let r=e.getTime();if(this.#i&&r<this.#i.getTime())throw new Error(on.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#o&&r>this.#o.getTime())throw new Error(on.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#g(e=!1){let r=e?ct.DateMathOp.Subtract:ct.DateMathOp.Add,n=new ct.CronDate(this.#n),i=n.getTime(),o=0;for(;++o<sR;){if(this.#h(n),!this.#l(n)){n.applyDateOperation(r,ct.TimeUnit.Day,this.#r.hour.values.length);continue}if(!(this.#r.dayOfWeek.nthDay<=0||Math.ceil(n.getDate()/7)===this.#r.dayOfWeek.nthDay)){n.applyDateOperation(r,ct.TimeUnit.Day,this.#r.hour.values.length);continue}if(!t.#a(n.getMonth()+1,this.#r.month.values)){n.applyDateOperation(r,ct.TimeUnit.Month,this.#r.hour.values.length);continue}if(this.#m(n,r,e)){if(!t.#a(n.getMinutes(),this.#r.minute.values)){this.#p(n,r,e);continue}if(!t.#a(n.getSeconds(),this.#r.second.values)){this.#A(n,r,e);continue}if(i===n.getTime()){(r==="Add"||n.getMilliseconds()===0)&&n.applyDateOperation(r,ct.TimeUnit.Second,this.#r.hour.values.length);continue}break}}if(o>sR)throw new Error(on.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return n.getMilliseconds()!==0&&n.setMilliseconds(0),this.#n=n,n}[Symbol.iterator](){return{next:()=>({value:this.#g(),done:!this.hasNext()})}}};on.CronExpression=Vp;on.default=Vp});var aR=m(FI=>{"use strict";Object.defineProperty(FI,"__esModule",{value:!0});FI.seededRandom=h3;function p3(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return()=>e>>>0}function f3(t){return()=>{let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function h3(t){let e=t?p3(t)():Math.floor(Math.random()*1e10);return f3(e)}});var Jp=m(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.CronExpressionParser=cn.DayOfWeek=cn.Months=cn.CronUnit=cn.PredefinedExpressions=void 0;var g3=LI(),m3=PI(),y3=aR(),sn=Gp(),$I;(function(t){t["@yearly"]="0 0 0 1 1 *",t["@annually"]="0 0 0 1 1 *",t["@monthly"]="0 0 0 1 * *",t["@weekly"]="0 0 0 * * 0",t["@daily"]="0 0 0 * * *",t["@hourly"]="0 0 * * * *",t["@minutely"]="0 * * * * *",t["@secondly"]="* * * * * *",t["@weekdays"]="0 0 0 * * 1-5",t["@weekends"]="0 0 0 * * 0,6"})($I||(cn.PredefinedExpressions=$I={}));var an;(function(t){t.Second="Second",t.Minute="Minute",t.Hour="Hour",t.DayOfMonth="DayOfMonth",t.Month="Month",t.DayOfWeek="DayOfWeek"})(an||(cn.CronUnit=an={}));var jI;(function(t){t[t.jan=1]="jan",t[t.feb=2]="feb",t[t.mar=3]="mar",t[t.apr=4]="apr",t[t.may=5]="may",t[t.jun=6]="jun",t[t.jul=7]="jul",t[t.aug=8]="aug",t[t.sep=9]="sep",t[t.oct=10]="oct",t[t.nov=11]="nov",t[t.dec=12]="dec"})(jI||(cn.Months=jI={}));var qI;(function(t){t[t.sun=0]="sun",t[t.mon=1]="mon",t[t.tue=2]="tue",t[t.wed=3]="wed",t[t.thu=4]="thu",t[t.fri=5]="fri",t[t.sat=6]="sat"})(qI||(cn.DayOfWeek=qI={}));var zI=class t{static parse(e,r={}){let{strict:n=!1,hashSeed:i}=r,o=(0,y3.seededRandom)(i);e=$I[e]||e;let s=t.#e(e,n);if(!(s.dayOfMonth==="*"||s.dayOfWeek==="*"||!n))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");let a=t.#t(an.Second,s.second,sn.CronSecond.constraints,o),c=t.#t(an.Minute,s.minute,sn.CronMinute.constraints,o),u=t.#t(an.Hour,s.hour,sn.CronHour.constraints,o),l=t.#t(an.Month,s.month,sn.CronMonth.constraints,o),d=t.#t(an.DayOfMonth,s.dayOfMonth,sn.CronDayOfMonth.constraints,o),{dayOfWeek:A,nthDayOfWeek:p}=t.#d(s.dayOfWeek),h=t.#t(an.DayOfWeek,A,sn.CronDayOfWeek.constraints,o),g=new g3.CronFieldCollection({second:new sn.CronSecond(a,{rawValue:s.second}),minute:new sn.CronMinute(c,{rawValue:s.minute}),hour:new sn.CronHour(u,{rawValue:s.hour}),dayOfMonth:new sn.CronDayOfMonth(d,{rawValue:s.dayOfMonth}),month:new sn.CronMonth(l,{rawValue:s.month}),dayOfWeek:new sn.CronDayOfWeek(h,{rawValue:s.dayOfWeek,nthDayOfWeek:p})});return new m3.CronExpression(g,{...r,expression:e})}static#e(e,r){if(r&&!e.length)throw new Error("Invalid cron expression");e=e||"0 * * * * *";let n=e.trim().split(/\s+/);if(r&&n.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(n.length>6)throw new Error("Invalid cron expression, too many fields");let i=["*","*","*","*","*","0"];n.length<i.length&&n.unshift(...i.slice(n.length));let[o,s,a,c,u,l]=n;return{second:o,minute:s,hour:a,dayOfMonth:c,month:u,dayOfWeek:l}}static#t(e,r,n,i){if((e===an.Month||e===an.DayOfWeek)&&(r=r.replace(/[a-z]{3}/gi,o=>{o=o.toLowerCase();let s=jI[o]||qI[o];if(s===void 0)throw new Error(`Validation error, cannot resolve alias "${o}"`);return s.toString()})),!n.validChars.test(r))throw new Error(`Invalid characters, got value: ${r}`);return r=this.#n(r,n),r=this.#i(r,n,i),this.#o(e,r,n)}static#n(e,r){return e.replace(/[*?]/g,r.min+"-"+r.max)}static#i(e,r,n){let i=n();return e.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(o,s,a,c)=>{if(s&&a&&c){let u=parseInt(s,10),l=parseInt(a,10),d=parseInt(c,10);if(u>l)throw new Error(`Invalid range: ${u}-${l}, min > max`);if(d<=0)throw new Error(`Invalid step: ${d}, must be positive`);let A=Math.max(u,r.min),p=Math.floor(i*d),h=[];for(let g=Math.floor(A/d)*d+p;g<=l;g+=d)g>=A&&h.push(g);return h.join(",")}else if(s&&a){let u=parseInt(s,10),l=parseInt(a,10);if(u>l)throw new Error(`Invalid range: ${u}-${l}, min > max`);return String(Math.floor(i*(l-u+1))+u)}else if(c){let u=parseInt(c,10);if(u<=0)throw new Error(`Invalid step: ${u}, must be positive`);let l=Math.floor(i*u),d=[];for(let A=Math.floor(r.min/u)*u+l;A<=r.max;A+=u)A>=r.min&&d.push(A);return d.join(",")}else return String(Math.floor(i*(r.max-r.min+1)+r.min))})}static#o(e,r,n){let i=[];function o(a,c){if(Array.isArray(a))i.push(...a);else if(t.#A(c,a))i.push(a);else{let u=parseInt(a.toString(),10);if(!(u>=c.min&&u<=c.max))throw new Error(`Constraint error, got value ${a} expected range ${c.min}-${c.max}`);i.push(e===an.DayOfWeek?u%7:a)}}return r.split(",").forEach(a=>{if(!(a.length>0))throw new Error("Invalid list value format");o(t.#r(e,a,n),n)}),i}static#r(e,r,n){let i=r.split("/");if(i.length>2)throw new Error(`Invalid repeat: ${r}`);return i.length===2?(isNaN(parseInt(i[0],10))||(i[0]=`${i[0]}-${n.max}`),t.#u(e,i[0],parseInt(i[1],10),n)):t.#u(e,r,1,n)}static#c(e,r,n){if(!(!isNaN(e)&&!isNaN(r)&&e>=n.min&&r<=n.max))throw new Error(`Constraint error, got range ${e}-${r} expected range ${n.min}-${n.max}`);if(e>r)throw new Error(`Invalid range: ${e}-${r}, min(${e}) > max(${r})`)}static#s(e){if(!(!isNaN(e)&&e>0))throw new Error(`Constraint error, cannot repeat at every ${e} time.`)}static#a(e,r,n,i){let o=[];e===an.DayOfWeek&&n%7===0&&o.push(0);for(let s=r;s<=n;s+=i)o.indexOf(s)===-1&&o.push(s);return o}static#u(e,r,n,i){let o=r.split("-");if(o.length<=1)return isNaN(+r)?r:+r;let[s,a]=o.map(c=>parseInt(c,10));return this.#c(s,a,i),this.#s(n),this.#a(e,s,a,n)}static#d(e){let r=e.split("#");if(r.length<=1)return{dayOfWeek:r[0]};let n=+r[r.length-1],i=e.match(/([,-/])/);if(i!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${i?.[0]}\` special characters are incompatible`);if(!(r.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:r[0],nthDayOfWeek:n}}static#A(e,r){return e.chars.some(n=>r.toString().includes(n))}};cn.CronExpressionParser=zI});var cR=m(Jn=>{"use strict";var E3=Jn&&Jn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I3=Jn&&Jn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C3=Jn&&Jn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&E3(r,e,n[i]);return I3(r,e),r}})();Object.defineProperty(Jn,"__esModule",{value:!0});Jn.CronFileParser=void 0;var b3=Jp(),HI=class t{static async parseFile(e){let{readFile:r}=await Promise.resolve().then(()=>C3(require("fs/promises"))),n=await r(e,"utf8");return t.#e(n)}static parseFileSync(e){let{readFileSync:r}=require("fs"),n=r(e,"utf8");return t.#e(n)}static#e(e){let r=e.split(`
|
|
@@ -1008,7 +1008,9 @@ qbXML rules: QuickBooks validates element order strictly against Intuit's onscre
|
|
|
1008
1008
|
|
|
1009
1009
|
Run one request at a time: parallel sessions hung and crashed QuickBooks in testing, so never run tools in parallel or schedule overlapping runs. Page with iterator="Start" and then iterator="Continue" with the returned iteratorID until iteratorRemainingCount is 0, all inside one script; an iteratorID from an earlier script fails with 3391. AccountQuery and EmployeeQuery reject iterators; query them without paging or MaxReturned. Line items require IncludeLineItems true, inactive list records require ActiveStatus All, and custom fields require OwnerID 0 (returned as DataExtRet). Use IncludeRetElement to limit fields. Filter transactions with TxnDateRangeFilter or ModifiedDateRangeFilter and lists with FromModifiedDate. Jobs use the full name "Customer:Job". Times are in the host's local time zone, so add an overlap for incremental syncs on TimeModified. Amounts are strings. Reports return ReportRet rows and columns that need flattening. Responses above 50 MB exceed the per-call limit; split by date range or type.
|
|
1010
1010
|
|
|
1011
|
-
Status codes: 1 means no matching records (normal). 500 means an invalid ListID or TxnID. 1000 often means the feature is off in that company; check PreferencesQuery. 3250 means the feature is not enabled. 80040423 means an unsupported qbXML version. 80040414 (a dialog is open in QuickBooks) and 80040421 (a stray QuickBooks process holds another file) need someone at the host to close the dialog or end QBW, QBDBMgrN or cscript processes; report them and do not retry in a loop. After a plain timeout, verify whether each write committed before retrying it; retry read-only requests once. Writes need the record's current EditSequence for modifies and explicit user approval before they run.`},sage_intacct:{name:"sage_intacct",apiUrl:"https://api.intacct.com/ia/xml/xmlgw.phtml",regex:"^.*(intacct|sage.*intacct).*$",icon:"sage",docsUrl:"https://developer.intacct.com/web-services/",preferredAuthType:"api_key",oauth:{authUrl:"https://api.intacct.com/ia/api/v1/oauth2/authorize",tokenUrl:"https://api.intacct.com/ia/api/v1/oauth2/token",scopes:"offline_access",grant_type:"authorization_code",tokenAuthMethod:"body",tokenContentType:"form"},keywords:["accounting","erp","general ledger","accounts payable","accounts receivable","invoices","bills","vendors","customers","journal entries","cash management","purchasing","order entry","projects","contracts","financial reports","dimensions","budgets","consolidation","multi-entity"],systemSpecificInstructions:`
|
|
1011
|
+
Status codes: 1 means no matching records (normal). 500 means an invalid ListID or TxnID. 1000 often means the feature is off in that company; check PreferencesQuery. 3250 means the feature is not enabled. 80040423 means an unsupported qbXML version. 80040414 (a dialog is open in QuickBooks) and 80040421 (a stray QuickBooks process holds another file) need someone at the host to close the dialog or end QBW, QBDBMgrN or cscript processes; report them and do not retry in a loop. After a plain timeout, verify whether each write committed before retrying it; retry read-only requests once. Writes need the record's current EditSequence for modifies and explicit user approval before they run.`},sage_intacct:{name:"sage_intacct",apiUrl:"https://api.intacct.com/ia/xml/xmlgw.phtml",regex:"^.*(intacct|sage.*intacct).*$",icon:"sage",docsUrl:"https://developer.intacct.com/web-services/",preferredAuthType:"api_key",oauth:{authUrl:"https://api.intacct.com/ia/api/v1/oauth2/authorize",tokenUrl:"https://api.intacct.com/ia/api/v1/oauth2/token",scopes:"offline_access",grant_type:"authorization_code",tokenAuthMethod:"body",tokenContentType:"form"},keywords:["accounting","erp","general ledger","accounts payable","accounts receivable","invoices","bills","vendors","customers","journal entries","cash management","purchasing","order entry","projects","contracts","financial reports","dimensions","budgets","consolidation","multi-entity"],systemSpecificInstructions:`Load the sage-intacct skill before working with this system.
|
|
1012
|
+
|
|
1013
|
+
Sage Intacct has two API surfaces:
|
|
1012
1014
|
- REST API: newer JSON API, base URL https://api.intacct.com/ia/api/v1, OAuth 2.0 bearer auth (authorize/token endpoints under /oauth2/, scope offline_access for refresh tokens). REST docs: https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi
|
|
1013
1015
|
- XML Web Services API: older but still required for many finance and legacy/object-specific operations. All requests are XML POST bodies to https://api.intacct.com/ia/xml/xmlgw.phtml
|
|
1014
1016
|
- Coverage differs: prefer REST when it exposes the needed objects, use XML when it does not.
|
|
@@ -1152,7 +1154,9 @@ REQUEST BODY STRUCTURE:
|
|
|
1152
1154
|
}
|
|
1153
1155
|
}
|
|
1154
1156
|
|
|
1155
|
-
Multiple actions can be batched in a single request. No OpenAPI spec is publicly available \u2014 all endpoints are documented at https://apidoc.onoffice.de/.`},acumatica:{name:"acumatica",apiUrl:"https://{host}/{tenant}/entity/Default/{endpointVersion}",regex:"^.*(acumatica|/entity/[A-Za-z0-9_]+/\\d{2}\\.\\d{3}\\.\\d{3}(/|$)).*$",icon:"/logos/acumatica.svg",docsUrl:"https://help.acumatica.com/",preferredAuthType:"oauth2",oauth:{authUrl:"https://{host}/{tenant}/identity/connect/authorize",tokenUrl:"https://{host}/{tenant}/identity/connect/token",scopes:"openid offline_access api",grant_type:"authorization_code",tokenAuthMethod:"body",tokenContentType:"form",usePKCE:!0},keywords:["records","sales orders","purchase orders","invoices","customers","vendors","inventory items","stock items","journal entries","accounts","employees","shipments","opportunities","cases"],systemSpecificInstructions:`
|
|
1157
|
+
Multiple actions can be batched in a single request. No OpenAPI spec is publicly available \u2014 all endpoints are documented at https://apidoc.onoffice.de/.`},acumatica:{name:"acumatica",apiUrl:"https://{host}/{tenant}/entity/Default/{endpointVersion}",regex:"^.*(acumatica|/entity/[A-Za-z0-9_]+/\\d{2}\\.\\d{3}\\.\\d{3}(/|$)).*$",icon:"/logos/acumatica.svg",docsUrl:"https://help.acumatica.com/",preferredAuthType:"oauth2",oauth:{authUrl:"https://{host}/{tenant}/identity/connect/authorize",tokenUrl:"https://{host}/{tenant}/identity/connect/token",scopes:"openid offline_access api",grant_type:"authorization_code",tokenAuthMethod:"body",tokenContentType:"form",usePKCE:!0},keywords:["records","sales orders","purchase orders","invoices","customers","vendors","inventory items","stock items","journal entries","accounts","employees","shipments","opportunities","cases"],systemSpecificInstructions:`Load the acumatica skill before working with this system.
|
|
1158
|
+
|
|
1159
|
+
Acumatica is multi-tenant and self-hosted by resellers/VARs, so {host} and {tenant} (the instance name in the URL path) vary per customer \u2014 get both from the customer's Acumatica login URL. Many cloud sites, such as https://client.acumatica.com, have no instance name; then drop the {tenant} path segment from every URL. {endpointVersion} is the contract version enabled on that specific instance (e.g. "25.200.001"); it is not a fixed superglue-side constant and must be confirmed per tenant, typically via the Web Service Endpoints screen (SM207060) or by calling /entity with no version to list available endpoints.
|
|
1156
1160
|
|
|
1157
1161
|
Prefer OAuth with the Authorization Code flow, signed in by a dedicated API user. It requires a "Connected Application" registered in Acumatica (screen SM303010, HTTPS only) with the superglue redirect URI, plus a dedicated API user with an "API" or "Unrestricted" login type user role \u2014 OAuth registration alone is not sufficient. superglue does not support the Resource Owner Password flow, so do not offer it.
|
|
1158
1162
|
|
|
@@ -1164,13 +1168,15 @@ Branch access is role-based: each branch names an access role (Branches screen C
|
|
|
1164
1168
|
|
|
1165
1169
|
CRITICAL \u2014 the concurrent API user limit is the most common Acumatica integration failure and it presents as an authentication error when it is not one. The instance licence caps concurrent web-services sessions via "Maximum Number of Web Services API Users" on the License Monitoring Console (SM604000), frequently as low as 3 to 6. Two behaviours exhaust it: any request that does not carry the existing session cookie opens a NEW session and consumes another slot, so a client that re-authenticates per request burns the entire licence within a handful of calls; and a session never closed with POST /entity/auth/logout stays open until it times out on its own (roughly 20 minutes), so a crashed run leaves orphaned sessions holding slots. The failure surfaces as "API login limit exceeded". Do NOT treat it as bad credentials and do NOT retry the login \u2014 retrying consumes more slots and deepens the outage. Diagnose it as seat exhaustion, reuse one session for the whole run, and always log out. The concurrent_access scope permits multiple simultaneous sessions on one token but still requires closing them.
|
|
1166
1170
|
|
|
1167
|
-
Two further cautions. Client secrets on a Connected Application can carry expiry dates, so a previously working integration can fail on an expired secret rather than a revoked grant \u2014 check the secret expiry before re-registering. And contract-based writes use PUT with upsert semantics matched on the entity's natural keys rather than a separate create endpoint, so an incomplete payload can silently create a second record instead of updating the intended one; confirm the key fields before writing, and get explicit user approval before any write or action call.`},netsuite:{name:"netsuite",apiUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest",regex:"^.*(netsuite|suitetalk\\.api\\.netsuite\\.com|app\\.netsuite\\.com).*$",icon:"/logos/netsuite.svg",docsUrl:"https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html",preferredAuthType:"oauth2",oauth:{authUrl:"https://{accountId}.app.netsuite.com/app/login/oauth2/authorize.nl",tokenUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token",scopes:"rest_webservices restlets",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!0},keywords:["records","customers","sales orders","invoices","items","vendors","purchase orders","employees","accounts","journal entries","payments","suiteql","datasets","metadata catalog","custom records"],systemSpecificInstructions:`
|
|
1171
|
+
Two further cautions. Client secrets on a Connected Application can carry expiry dates, so a previously working integration can fail on an expired secret rather than a revoked grant \u2014 check the secret expiry before re-registering. And contract-based writes use PUT with upsert semantics matched on the entity's natural keys rather than a separate create endpoint, so an incomplete payload can silently create a second record instead of updating the intended one; confirm the key fields before writing, and get explicit user approval before any write or action call.`},netsuite:{name:"netsuite",apiUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest",regex:"^.*(netsuite|suitetalk\\.api\\.netsuite\\.com|app\\.netsuite\\.com).*$",icon:"/logos/netsuite.svg",docsUrl:"https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html",preferredAuthType:"oauth2",oauth:{authUrl:"https://{accountId}.app.netsuite.com/app/login/oauth2/authorize.nl",tokenUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token",scopes:"rest_webservices restlets",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!0},keywords:["records","customers","sales orders","invoices","items","vendors","purchase orders","employees","accounts","journal entries","payments","suiteql","datasets","metadata catalog","custom records"],systemSpecificInstructions:`Load the netsuite skill before working with this system.
|
|
1172
|
+
|
|
1173
|
+
NetSuite REST Web Services are account-specific: replace {accountId} in apiUrl, authUrl, and tokenUrl with the account ID from Setup > Company > Company Information > Company URLs. Every REST request needs the full URL: <<systemId_url>>/record/v1/<recordType> for records and <<systemId_url>>/query/v1/suiteql for SuiteQL; a relative path such as /record/v1/customer fails with Invalid URL. Do not copy the demo123 examples from Oracle docs.
|
|
1168
1174
|
|
|
1169
1175
|
Before OAuth works, enable REST Web Services and OAuth 2.0 in NetSuite, then create an integration record with Authorization Code Grant, REST Web Services, and RESTlets enabled. The redirect URI must exactly match the superglue OAuth callback, and NetSuite only shows the client ID/secret on first save. Request scopes rest_webservices and restlets and send client credentials as HTTP Basic to the form-encoded token endpoint. Metadata/OpenAPI is account-specific at /record/v1/metadata-catalog with Accept: application/swagger+json, so no public openApiUrl is configured. The sign-in lasts seven days; when a step gets 401 INVALID_LOGIN, the user reconnects NetSuite in superglue.
|
|
1170
1176
|
|
|
1171
1177
|
SuiteQL runs as POST /query/v1/suiteql with the header Prefer: transient and a body like {"q": "SELECT id, companyname FROM customer WHERE isinactive = 'F'"}; page with ?limit=1000&offset=N and read hasMore in the response (100,000 rows per query at most). The offset must be a multiple of the limit, and the limit must be at least 2. SuiteQL returns every value as a string and dates in the user's date format: select TO_CHAR(field, 'YYYY-MM-DD') for ISO dates and BUILTIN.DF(field) for display names. For open amounts use transaction.foreignamountunpaid; the amountremaining columns can fail with UNEXPECTED_ERROR. Record list endpoints return 100 items by default and up to 1,000 with ?limit=1000. A record create answers 204 with the new record URL in the Location header, so set captureHttpResponse: true to read the ID. PATCH with ?replace=<sublist> (line, item, expense) replaces that sublist; without it, sent lines are added to the existing ones. Send X-NetSuite-idempotency-key with a fresh UUID on write requests so a retry is safe. The account allows 15 concurrent requests by default, shared by REST and RESTlets, and answers 429 CONCURRENCY_LIMIT_EXCEEDED instead of queuing: run NetSuite steps in sequence and retry after a short wait.
|
|
1172
1178
|
|
|
1173
|
-
The REST API reads and writes records only. It cannot create or change account structure: custom fields, custom record types, custom lists, forms, workflows, saved searches, roles, or scripts. Use the suitecloud protocol on this same system for structure. Step URL: suitecloud://{accountId}.app.netsuite.com, with the same {accountId} host prefix as apiUrl. The body is a JSON object with an operation (validate, preview, deploy, listObjects, importObjects, callRestlet); see the suitecloud reference for the project file format. It uses the same OAuth sign-in as the REST steps, so it runs as the connected user and role. The role needs the SuiteCloud Development Framework permissions; the standard Developer role has them. Setup guide: https://superglue.ai/docs/guides/netsuite-suitecloud/. Always run validate and preview and show the planned changes before deploy. A deploy step must set modify to true. Tell the user before the deploy when a change cannot be undone, such as enabling a feature.`},spotify:{name:"spotify",apiUrl:"https://api.spotify.com/v1",regex:"^.*(spotify|api\\.spotify\\.com).*$",icon:"spotify",docsUrl:"https://developer.spotify.com/documentation/web-api",openApiUrl:"https://developer.spotify.com/reference/web-api/open-api-schema.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.spotify.com/authorize",tokenUrl:"https://accounts.spotify.com/api/token",scopes:"user-read-private user-read-email",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!1},keywords:["albums","artists","tracks","playlists","users","shows","episodes","audiobooks","player","playback","search","recommendations","library","markets"],systemSpecificInstructions:`Register your app at https://developer.spotify.com/dashboard to obtain client_id and client_secret. The redirect URI must be added exactly in the dashboard \u2014 any mismatch causes an auth error.
|
|
1179
|
+
The REST API reads and writes records only. It cannot create or change account structure: custom fields, custom record types, custom lists, forms, workflows, saved searches, roles, or scripts. Use the suitecloud protocol on this same system for structure. Step URL: suitecloud://{accountId}.app.netsuite.com, with the same {accountId} host prefix as apiUrl. The body is a JSON object with an operation (validate, preview, deploy, listObjects, importObjects, listFiles, importFiles, callRestlet); see the suitecloud reference for the project file format. It uses the same OAuth sign-in as the REST steps, so it runs as the connected user and role. The role needs the SuiteCloud Development Framework permissions; the standard Developer role has them. Setup guide: https://superglue.ai/docs/guides/netsuite-suitecloud/. Always run validate and preview and show the planned changes before deploy. A deploy step must set modify to true. Tell the user before the deploy when a change cannot be undone, such as enabling a feature.`},spotify:{name:"spotify",apiUrl:"https://api.spotify.com/v1",regex:"^.*(spotify|api\\.spotify\\.com).*$",icon:"spotify",docsUrl:"https://developer.spotify.com/documentation/web-api",openApiUrl:"https://developer.spotify.com/reference/web-api/open-api-schema.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.spotify.com/authorize",tokenUrl:"https://accounts.spotify.com/api/token",scopes:"user-read-private user-read-email",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!1},keywords:["albums","artists","tracks","playlists","users","shows","episodes","audiobooks","player","playback","search","recommendations","library","markets"],systemSpecificInstructions:`Register your app at https://developer.spotify.com/dashboard to obtain client_id and client_secret. The redirect URI must be added exactly in the dashboard \u2014 any mismatch causes an auth error.
|
|
1174
1180
|
|
|
1175
1181
|
Token endpoint uses form-encoded body (not JSON) with client credentials in the Authorization: Basic base64(client_id:client_secret) header. Client Credentials flow (no user context) does not issue refresh tokens. PKCE is supported for public clients (no client_secret) \u2014 use usePKCE: true for SPA/mobile flows.`},spaceship:{name:"spaceship",apiUrl:"https://spaceship.dev/api/v1",regex:"^.*(spaceship\\.dev|\\bspaceship\\b).*$",icon:"spaceship",docsUrl:"https://docs.spaceship.dev",preferredAuthType:"api_key",keywords:["domains","dns","records","nameservers","contacts","registrar","whois","transfers","registration"],systemSpecificInstructions:"Authentication requires two headers on every request: X-Api-Key (your API key) and X-Api-Secret (your API secret). Generate both at https://spaceship.com/application/api-manager/."},promptwatch:{name:"promptwatch",apiUrl:"https://server.promptwatch.com/api/v2",regex:"^.*(promptwatch).*$",icon:"promptwatch",docsUrl:"https://promptwatch.com/docs",openApiUrl:"https://promptwatch.com/docs/v2/openapi.json",preferredAuthType:"api_key",keywords:["monitors","prompts","projects","responses","citations","brands","rank analysis","content gaps","sitemap","brand mentions","visibility","analytics","ai visibility"],systemSpecificInstructions:`Promptwatch API authentication:
|
|
1176
1182
|
|
|
@@ -1764,7 +1770,7 @@ ${s}`;return}if(Cy(e,i,KTe)){XTe(e,o)&&(r.retry=e.toString("utf8",o));return}if(
|
|
|
1764
1770
|
`);t.stack=r?`${r}
|
|
1765
1771
|
${o}`:i.stack}V.exports.fetch=function(e,r=void 0){return kRe(e,r).catch(n=>{throw pG?mG(n,pG):n&&typeof n=="object"&&Error.captureStackTrace(n,V.exports.fetch),n})};V.exports.Headers=oc().Headers;V.exports.Response=RA().Response;V.exports.Request=Uu().Request;V.exports.FormData=zg().FormData;var{setGlobalOrigin:NRe,getGlobalOrigin:ORe}=ZS();V.exports.setGlobalOrigin=NRe;V.exports.getGlobalOrigin=ORe;var{CacheStorage:URe}=tH(),{kConstruct:MRe}=$e();V.exports.caches=new URe(MRe);var{deleteCookie:xRe,getCookies:LRe,getSetCookies:PRe,setCookie:FRe,parseCookie:$Re}=pH();V.exports.deleteCookie=xRe;V.exports.getCookies=LRe;V.exports.getSetCookies=PRe;V.exports.setCookie=FRe;V.exports.parseCookie=$Re;var{parseMIMEType:jRe,serializeAMimeType:qRe}=In();V.exports.parseMIMEType=jRe;V.exports.serializeAMimeType=qRe;var{CloseEvent:zRe,ErrorEvent:HRe,MessageEvent:GRe}=uy(),{WebSocket:YRe,ping:VRe}=GH();V.exports.WebSocket=YRe;V.exports.CloseEvent=zRe;V.exports.ErrorEvent=HRe;V.exports.MessageEvent=GRe;V.exports.ping=VRe;V.exports.WebSocketStream=eG().WebSocketStream;V.exports.WebSocketError=Rv().WebSocketError;V.exports.request=qA(Yu.request);V.exports.stream=qA(Yu.stream);V.exports.pipeline=qA(Yu.pipeline);V.exports.connect=qA(Yu.connect);V.exports.upgrade=qA(Yu.upgrade);V.exports.MockClient=IRe;V.exports.MockCallHistory=CRe;V.exports.MockCallHistoryLog=bRe;V.exports.MockPool=wRe;V.exports.MockAgent=SRe;V.exports.SnapshotAgent=BRe;V.exports.mockErrors=QRe;var{EventSource:JRe}=AG();V.exports.EventSource=JRe;function WRe(){globalThis.fetch=V.exports.fetch,globalThis.Headers=V.exports.Headers,globalThis.Response=V.exports.Response,globalThis.Request=V.exports.Request,globalThis.FormData=V.exports.FormData,globalThis.WebSocket=V.exports.WebSocket,globalThis.CloseEvent=V.exports.CloseEvent,globalThis.ErrorEvent=V.exports.ErrorEvent,globalThis.MessageEvent=V.exports.MessageEvent,globalThis.EventSource=V.exports.EventSource}V.exports.install=WRe});var IG=m(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.SuperglueClient=Ju.SuperglueHttpError=void 0;var Vu=dr(),Dn=mb(),ZRe=Yb(),KRe=RL(),XRe=ln(),Vo=Lc(),eke=Xl(),HA=14400*1e3,zA;if(typeof globalThis.process<"u"&&globalThis.process.versions?.node)try{let{Agent:t}=yG();zA=new t({headersTimeout:HA,bodyTimeout:HA})}catch{}function EG(t){if(t?.aborted)throw t.reason??new DOMException("Aborted","AbortError")}var wy=class extends Error{constructor(e,r,n,i){super(e),this.status=r,this.code=n,this.details=i,this.name="SuperglueHttpError"}};Ju.SuperglueHttpError=wy;var xv=class{constructor({apiKey:e,apiEndpoint:r,onInfrastructureError:n,refreshToken:i,sseTokenProvider:o,tokenProvider:s}){if(!e&&!s)throw new Error("SuperglueClient requires either apiKey or tokenProvider");this.tokenProvider=s??(async()=>e),this.apiEndpoint=r??"https://api.superglue.cloud",this.sseManager=new ZRe.SSELogSubscriptionManager(this.apiEndpoint,o??this.tokenProvider,i),this.onInfrastructureError=n,this.refreshToken=i}async getApiKey(){return this.tokenProvider()}async fetchWithAuthRetry(e,r){let n=await this.getApiKey(),i=await e(n);if(i.status!==401||!this.refreshToken)return i;EG(r);let o=await this.refreshToken();return EG(r),!o||o===n?i:(i.body?.cancel(),e(o))}isInfrastructureError(e){return(0,XRe.isAbortError)(e)?!1:!!(e instanceof TypeError&&e.message.toLowerCase().includes("fetch")||e instanceof Error&&e.name==="TimeoutError")}async restRequest(e,r,n,i,o){let a=await(await this.restResponse({method:e,path:r,body:n,extraHeaders:i,requestInit:o})).text();if(a)return JSON.parse(a)}async restResponse({method:e,path:r,body:n,extraHeaders:i,requestInit:o}){let s=`${this.apiEndpoint.replace(/\/$/,"")}${r}`,a=n!=null,c=typeof FormData<"u"&&n instanceof FormData,u=d=>{let A={Authorization:`Bearer ${d}`,...i};return a&&!c&&e!=="GET"&&(A["Content-Type"]="application/json"),fetch(s,{...o,method:e,headers:A,body:a?c?n:JSON.stringify(n):void 0,signal:o?.signal??AbortSignal.timeout(HA),...zA?{dispatcher:zA}:{}})},l;try{l=await this.fetchWithAuthRetry(u,o?.signal)}catch(d){throw this.isInfrastructureError(d)&&this.onInfrastructureError?.(),d}if(!l.ok)throw await this.buildHttpError(l);return l}async uploadFiles(e,r){if(typeof r?.process!="boolean")throw new Error("process must be a boolean");if(e.length===0)return[];let n=e.map(l=>({...l,contentLength:l.contentLength??this.getUploadContentLength(l.content)})),o=(await this.restRequest("POST","/v1/files/uploads",{process:r.process,files:n.map(({fileName:l,contentType:d,contentLength:A})=>({fileName:l,contentLength:A,...d?{contentType:d}:{}}))})).data.files;if(o.length!==n.length)throw await Promise.all(o.map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),new Error("Upload response did not match the selected files");let s=await Promise.allSettled(o.map(async(l,d)=>{let A=n[d],p=await fetch(l.uploadUrl,{method:"PUT",body:A.content,headers:A.contentType?{"Content-Type":A.contentType}:void 0,signal:AbortSignal.timeout(Math.min(HA,l.expiresIn*1e3))});if(!p.ok)throw new Error(`Upload failed for ${A.fileName}: ${p.status} ${p.statusText}`);return l.id})),a=s.flatMap(l=>l.status==="fulfilled"?[l.value]:[]),c=new Map;if(a.length>0)try{let l=await this.restRequest("POST","/v1/files/uploads/complete",{fileIds:a});c=new Map(l.data.files.map(d=>[d.id,d]))}catch(l){c=new Map(a.map(d=>[d,{id:d,fileName:n[o.findIndex(A=>A.id===d)]?.fileName||d,contentLength:n[o.findIndex(A=>A.id===d)]?.contentLength||0,status:"failed",error:l instanceof Error?l.message:String(l)}]))}let u=o.map((l,d)=>{let A=s[d],p=n[d];return A.status==="rejected"?{id:l.id,fileName:p.fileName,contentLength:p.contentLength,status:"failed",error:A.reason instanceof Error?A.reason.message:String(A.reason)}:c.get(l.id)||{id:l.id,fileName:p.fileName,contentLength:p.contentLength,status:"failed",error:"Upload completion returned no result"}});return await Promise.all(u.filter(l=>l.status==="failed").map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),u}async deleteFileUpload(e){await this.restRequest("DELETE",`/v1/files/uploads/${encodeURIComponent(e)}`)}getUploadContentLength(e){return typeof e=="string"?new TextEncoder().encode(e).byteLength:e instanceof Uint8Array?e.byteLength:e.size}async buildHttpError(e){e.status>=500&&this.onInfrastructureError?.();let r=await e.text(),n=`HTTP ${e.status}: ${r}`,i,o;try{let s=JSON.parse(r);s&&typeof s=="object"&&!Array.isArray(s)&&(o=s),typeof s?.code=="string"&&(i=s.code);let a=s.error;typeof a=="string"?n=a:a&&typeof a=="object"&&(n=a.message||JSON.stringify(a))}catch{}return new wy(n,e.status,i,o)}async streamRequest(e,r,n){let i=e.includes("?")?"&":"?",o=`${this.apiEndpoint.replace(/\/$/,"")}${e}${i}stream=true`,s=u=>fetch(o,{method:"POST",headers:{Authorization:`Bearer ${u}`,Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(r),signal:n??AbortSignal.timeout(HA),...zA?{dispatcher:zA}:{}}),a;try{a=await this.fetchWithAuthRetry(s,n)}catch(u){throw this.isInfrastructureError(u)&&this.onInfrastructureError?.(),u}if(!a.ok)throw await this.buildHttpError(a);if(!(a.headers.get("content-type")||"").includes("text/event-stream")){let u=await a.text();return u?JSON.parse(u):void 0}try{return await(0,KRe.consumeEventStreamResult)(a)}catch(u){throw this.isInfrastructureError(u)&&this.onInfrastructureError?.(),u}}async subscribeToLogsSSE(e={}){return this.sseManager.subscribeToLogs(e)}async disconnect(){await this.sseManager.disconnect()}async listMemoryNotes(e={}){let r=new URLSearchParams;e.scope&&r.set("scope",e.scope),e.query&&r.set("query",e.query);let n=r.toString();return(await this.restRequest("GET",`/v1/memory-notes${n?`?${n}`:""}`)).data}async createMemoryNote(e){return(await this.restRequest("POST","/v1/memory-notes",e)).data}async updateMemoryNote(e,r){return(await this.restRequest("PATCH",`/v1/memory-notes/${encodeURIComponent(e)}`,r)).data}async deleteMemoryNote(e){await this.restRequest("DELETE",`/v1/memory-notes/${encodeURIComponent(e)}`)}async clearMemoryNotes(e){return(await this.restRequest("DELETE",`/v1/memory-notes?scope=${e}`)).data.deleted}async getMe(){return this.restRequest("GET","/v1/me")}async completeOnboarding(){return this.restRequest("POST","/v1/me/onboarding/complete")}async runTool(e){let r=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e.toolId)}/run`,{inputs:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture},void 0,e.signal?{signal:e.signal}:void 0);return{success:r.status==="success",data:r.data,error:r.error,tool:r.tool,stepResults:r.stepResults?.map(n=>({...n}))||[],...r.fileArtifacts&&r.fileArtifacts.length>0?{fileArtifacts:r.fileArtifacts}:{},...r.metadata?.warnings?.length?{warnings:r.metadata.warnings}:{}}}async runToolConfig(e){let r=e.createRun?"/v1/tools/run?createRun=true":"/v1/tools/run",n=await this.restRequest("POST",r,{tool:e.tool,payload:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture,executionKind:e.executionKind,parentToolId:e.parentToolId,draftId:e.draftId},e.traceId?{"X-Trace-Id":e.traceId}:void 0,e.signal?{signal:e.signal}:void 0);return{success:n.status?n.status==="success":n.success??!1,data:n.data,error:n.error,tool:n.tool||e.tool,stepResults:n.stepResults?.map(o=>({...o}))||[],...n.fileArtifacts&&n.fileArtifacts.length>0?{fileArtifacts:n.fileArtifacts}:{},...n.metadata?.warnings?.length?{warnings:n.metadata.warnings}:{}}}async abortToolExecution(e){return{success:!0,runId:(await this.restRequest("POST",`/v1/runs/${encodeURIComponent(e)}/cancel`)).runId}}async executeStep({step:e,payload:r,files:n,previousResults:i,credentials:o,options:s,runId:a,systemIds:c,credentialId:u,systemAuth:l,createRun:d,parentToolId:A,stepIndex:p,stepId:h,signal:g,stream:S}){let B={step:e,payload:r,files:n,previousResults:i,credentials:o,options:s,runId:a,systemIds:c,credentialId:u,systemAuth:l,createRun:d,parentToolId:A,stepIndex:p,stepId:h};return S?this.streamRequest("/v1/tools/step/run",B,g):this.restRequest("POST","/v1/tools/step/run",B,void 0,g?{signal:g}:void 0)}async abortStep(e){return this.restRequest("POST","/v1/tools/step/abort",{runId:e})}async executeTransformOnly({outputTransform:e,outputSchema:r,inputSchema:n,payload:i,files:o,stepResults:s,options:a,runId:c,createRun:u,parentToolId:l,stepId:d,signal:A,stream:p}){let h={outputTransform:e,outputSchema:r,inputSchema:n,payload:i,files:o,stepResults:s,options:a,runId:c,createRun:u,parentToolId:l,stepId:d};return p?this.streamRequest("/v1/tools/transform/run",h,A):this.restRequest("POST","/v1/tools/transform/run",h,void 0,A?{signal:A}:void 0)}async createRun({toolId:e,toolConfig:r,toolResult:n,stepResults:i,toolPayload:o,status:s,error:a,startedAt:c,completedAt:u,executionKind:l,parentToolId:d,draftId:A}){return this.restRequest("POST","/v1/runs",{toolId:e,toolConfig:r,toolResult:n,stepResults:i,toolPayload:o,status:s,error:a,startedAt:(0,Vo.toUTCISOString)(c,"run.startedAt"),completedAt:(0,Vo.toUTCISOString)(u,"run.completedAt"),executionKind:l,parentToolId:d,draftId:A})}async checkRunLimit(){return(await this.restRequest("POST","/v1/runs/check-limit")).data}async extract({file:e,envelope:r}){if(!e)throw new Error("File must be provided for extract.");let n=new FormData;n.append("file",e);let i=r?"/v1/extract?envelope=true":"/v1/extract";return this.restRequest("POST",i,n)}mapOpenAPIRunToRun(e){let r={running:Vu.RunStatus.RUNNING,success:Vu.RunStatus.SUCCESS,failed:Vu.RunStatus.FAILED,aborted:Vu.RunStatus.ABORTED};return{runId:e.runId??e.id,toolId:e.toolId,tool:e.tool,systemIds:e.systemIds,status:r[e.status]??Vu.RunStatus.FAILED,toolPayload:e.toolPayload,data:e.data,toolResult:e.data,error:e.error,stepResults:e.stepResults,options:e.options,requestSource:e.requestSource,traceId:e.traceId,resultStorageUri:e.resultStorageUri,userId:e.userId,userEmail:e.userEmail,userName:e.userName,metadata:{...e.metadata,executionKind:e.metadata?.executionKind??Vu.RunExecutionKind.FULL},fileArtifacts:e.fileArtifacts}}mapOpenAPIScheduleToToolSchedule(e){return{...e,lastRunAt:e.lastRunAt?(0,Vo.requireUTCDate)(e.lastRunAt,"schedule.lastRunAt"):void 0,nextRunAt:(0,Vo.requireUTCDate)(e.nextRunAt,"schedule.nextRunAt"),createdAt:(0,Vo.requireUTCDate)(e.createdAt,"schedule.createdAt"),updatedAt:(0,Vo.requireUTCDate)(e.updatedAt,"schedule.updatedAt")}}async listRuns(e={}){let r=(0,Dn.createSearchListQueryParams)(e);e.toolId!==void 0&&r.set("toolId",e.toolId),e.searchUserIds?.length&&r.set("searchUserIds",e.searchUserIds.join(",")),e.includeTotal!==void 0&&r.set("includeTotal",String(e.includeTotal)),e.startedAfter!==void 0&&r.set("startedAfter",e.startedAfter instanceof Date?(0,Vo.toUTCISOString)(e.startedAfter,"run.startedAfter"):e.startedAfter),e.statuses!==void 0?r.set("status",e.statuses.join(",")):e.status!==void 0&&r.set("status",e.status),e.requestSources!==void 0&&r.set("requestSources",e.requestSources.join(",")),e.executionKinds!==void 0&&r.set("executionKinds",e.executionKinds.join(",")),e.userId!==void 0&&r.set("userId",e.userId),e.systemId!==void 0&&r.set("systemId",e.systemId),e.systemIds!==void 0&&r.set("systemIds",e.systemIds.join(","));let n=r.size>0?`?${r.toString()}`:"",i=await this.restRequest("GET",`/v1/runs${n}`,void 0,void 0,{signal:e.signal});return{data:i.data.map(o=>this.mapOpenAPIRunToRun(o)),total:i.total,page:i.page,limit:i.limit,hasMore:i.hasMore}}async getActivityCounts(e){let r=new URLSearchParams;e?.from&&r.set("from",e.from instanceof Date?(0,Vo.toUTCISOString)(e.from,"activity.from"):e.from),e?.to&&r.set("to",e.to instanceof Date?(0,Vo.toUTCISOString)(e.to,"activity.to"):e.to);let n=r.toString();return(await this.restRequest("GET",`/v1/activity/counts${n?`?${n}`:""}`,void 0,void 0,{signal:e?.signal})).counts}async getRun(e){try{let r=await this.restRequest("GET",`/v1/runs/${encodeURIComponent(e)}`);return this.mapOpenAPIRunToRun(r)}catch(r){if(r.message?.includes("404")||r.message?.includes("not found"))return null;throw r}}async getTool(e){try{return await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}`)}catch(r){if(r.message?.includes("404")||r.message?.includes("not found")||r.message?.includes("403")||r.message?.includes("not allowed"))return null;throw r}}async getToolState(e){return(await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/state`)).state}async setToolState(e,r){await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/state`,{state:r})}async deleteToolState(e){return(await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/state`)).deletedKeys}async archiveTool(e,r=!0){return this.updateTool(e,{archived:r})}async bulkArchiveTools(e,r=!0){return this.restRequest("POST","/v1/tools/bulk/archive",{ids:e,archived:r})}async bulkDeleteTools(e){return this.restRequest("POST","/v1/tools/bulk/delete",{ids:e})}async listTools(e={}){let r=(0,Dn.createListQueryParams)(e);e.includeArchived!==void 0&&r.set("includeArchived",String(e.includeArchived));let n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/tools${n}`)}async listAllTools(e={}){return(0,Dn.listAllPages)((r,n)=>this.listTools({...e,page:r,limit:n}))}async createTool(e,r){return this.restRequest("POST","/v1/tools",{...r,id:e})}async updateTool(e,r){return this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}`,r)}async deleteTool(e){try{return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}`),!0}catch(r){if(r.message?.includes("404"))return!1;throw r}}async renameTool(e,r){return this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/rename`,{newId:r})}async getWorkflow(e){return this.getTool(e)}async archiveWorkflow(e,r=!0){return this.upsertWorkflow(e,{archived:r})}async createWorkflow(e,r){return this.createTool(e,r)}async updateWorkflow(e,r){return this.updateTool(e,r)}async upsertWorkflow(e,r){return await this.getTool(e)?this.updateTool(e,r):this.createTool(e,r)}async deleteWorkflow(e){return this.deleteTool(e)}async renameWorkflow(e,r){return this.renameTool(e,r)}async listProjectSummaries(e={}){let r=(0,Dn.createSearchListQueryParams)(e);return r.set("includeResources","false"),e.includeArchived!==void 0&&r.set("includeArchived",String(e.includeArchived)),this.restRequest("GET",`/v1/projects?${r.toString()}`)}async listAllProjectSummaries({includeArchived:e}={}){return(0,Dn.listAllPages)((r,n)=>this.listProjectSummaries({page:r,limit:n,...e!==void 0?{includeArchived:e}:{}}))}async listAllProjectTasks(e){return(0,Dn.listAllPages)((r,n)=>this.restRequest("GET",`/v1/projects/${encodeURIComponent(e)}/tasks?page=${r}&limit=${n}`))}async saveProjectTask({projectId:e,taskId:r,input:n}){let i=`/v1/projects/${encodeURIComponent(e)}/tasks${r?`/${encodeURIComponent(r)}`:""}`;return(await this.restRequest(r?"PATCH":"POST",i,n)).data}async listSchedules(e={}){let r=(0,Dn.createListQueryParams)(e),n=r.size>0?`?${r.toString()}`:"",i=e.toolId?`/v1/tools/${encodeURIComponent(e.toolId)}/schedules${n}`:`/v1/schedules${n}`,o=await this.restRequest("GET",i);return{...o,data:o.data.map(s=>this.mapOpenAPIScheduleToToolSchedule(s))}}async listAllSchedules(e={}){return(0,Dn.listAllPages)((r,n)=>this.listSchedules({...e,page:r,limit:n}))}async getToolSchedule(e,r){try{let n=await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`);return this.mapOpenAPIScheduleToToolSchedule(n)}catch(n){if(n.message?.includes("404")||n.message?.includes("not found"))return null;throw n}}async createToolSchedule(e,r){let n=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/schedules`,{...r,timezone:r.timezone||(0,eke.getRuntimeTimezone)()});return this.mapOpenAPIScheduleToToolSchedule(n)}async updateToolSchedule(e,r,n){let i=await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`,n);return this.mapOpenAPIScheduleToToolSchedule(i)}async deleteToolSchedule(e,r){return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`),!0}async bulkSetSchedulesEnabled(e,r){return this.restRequest("POST","/v1/schedules/bulk/enable",{ids:e,enabled:r})}async bulkDeleteSchedules(e){return this.restRequest("POST","/v1/schedules/bulk/delete",{ids:e})}async listCredentials(e={}){let r=(0,Dn.createListQueryParams)(e);e.systemId!==void 0&&r.set("systemId",e.systemId);let n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/credentials${n}`)}async listAllCredentials(e={}){return(0,Dn.listAllPages)((r,n)=>this.listCredentials({...e,page:r,limit:n}))}async createCredentials(e){return(await this.restRequest("POST","/v1/credentials",e)).data}async replaceCredentials(e,r){return(await this.restRequest("PUT",`/v1/credentials/${encodeURIComponent(e)}`,{credentials:r})).data}async updateCredentials(e,r){return(await this.restRequest("PATCH",`/v1/credentials/${encodeURIComponent(e)}`,r)).data}async deleteCredentials(e){await this.restRequest("DELETE",`/v1/credentials/${encodeURIComponent(e)}`)}async setDefaultCredentials(e){await this.restRequest("POST",`/v1/credentials/${encodeURIComponent(e)}/default`)}async listSystems(e={}){let r=(0,Dn.createListQueryParams)(e),n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/systems${n}`)}async listAllSystems(e={}){return(0,Dn.listAllPages)((r,n)=>this.listSystems({...e,page:r,limit:n}))}async getSystem(e){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}`)).data}async createSystem(e){return(await this.restRequest("POST","/v1/systems",e)).data}async updateSystem(e,r){return(await this.restRequest("PATCH",`/v1/systems/${encodeURIComponent(e)}`,r)).data}async deleteSystem(e){return await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}`),!0}async bulkDeleteSystems(e){return this.restRequest("POST","/v1/systems/bulk/delete",{ids:e})}async listManagedOAuthTemplateIds(){return(await this.restRequest("GET","/v1/oauth2/managed-apps")).data.templateIds}async createOAuthExchange(e){return(await this.restRequest("POST","/v1/oauth/exchanges",e)).data}async completeOAuthExchange(e,r){return(await this.restRequest("POST",`/v1/oauth/exchanges/${encodeURIComponent(e)}/complete`,r)).data}async searchSystemDocumentation(e,r){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/search`,{keywords:r})).data}async triggerSystemDocumentationScrapeJob(e,r){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/scrape`,r)).data}async fetchOpenApiSpec(e,r,n){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/openapi`,{url:r,link:n?.link})).data}async uploadSystemDocumentationFiles(e,r,n){let i=await this.uploadFiles(r,{process:!0}),o=i.flatMap(s=>s.status==="uploaded"?[s.id]:[]);if(o.length>0)try{await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/files`,{fileIds:o,link:n?.link!==!1})}catch(s){throw await Promise.all(o.map(a=>this.deleteFileUpload(a).catch(()=>{}))),s}if(!n?.settle){let s=i.filter(a=>a.status==="failed");if(s.length>0)throw new Error(s.map(a=>a.error).join("; "))}return i}async listSystemDocumentationFiles(e,r){let n=new URLSearchParams;r?.length&&n.set("fileIds",r.join(","));let i=n.size>0?`?${n.toString()}`:"";return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files${i}`)).data}async getSystemDocumentationFileContent(e,r,n){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(r)}/content?processed=${n.processed}`)).data}async deleteSystemDocumentationFile(e,r){await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(r)}`)}async generateCredentialsLink(e){try{return{success:!0,credentialsUrl:(await this.restRequest("POST","/v1/authenticate",e||{})).data.credentialsUrl}}catch(r){return{success:!1,error:r.message}}}};Ju.SuperglueClient=xv});var bG=m(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.UnquotedKeyStrategy=at.TripleQuoteStrategy=at.TrailingCommaStrategy=at.SingleQuoteStrategy=at.PythonLiteralStrategy=at.CommentStrategy=at.ResilientJsonParser=at.RepairStrategy=void 0;at.parseJsonResilient=tke;at.parseJSON=rke;at.isValidJson=nke;at.prettyPrintJson=ike;at.minifyJson=oke;var Yn=class{validate(e){try{return JSON.parse(e),!0}catch{return!1}}};at.RepairStrategy=Yn;var By=class extends Yn{constructor(){super(...arguments),this.name="TripleQuoteRepair",this.description="Converts triple-quoted strings to proper JSON, parsing nested JSON content"}canApply(e){return/"""/.test(e)}apply(e){return e.replace(/"""([\s\S]*?)"""/g,(r,n)=>{let i=n.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{let s=JSON.parse(i);return JSON.stringify(s)}catch{return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`})}};at.TripleQuoteStrategy=By;var Qy=class extends Yn{constructor(){super(...arguments),this.name="PythonLiteralRepair",this.description="Converts Python literals to JavaScript equivalents"}canApply(e){return/\b(None|True|False)\b/.test(e)}apply(e){return e.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false")}};at.PythonLiteralStrategy=Qy;var vy=class extends Yn{constructor(){super(...arguments),this.name="TrailingCommaRepair",this.description="Removes trailing commas from objects and arrays"}canApply(e){return/,\s*[}\]]/.test(e)}apply(e){return e.replace(/,(\s*[}\]])/g,"$1")}};at.TrailingCommaStrategy=vy;var _y=class extends Yn{constructor(){super(...arguments),this.name="SingleQuoteRepair",this.description="Converts single quotes to double quotes"}canApply(e){return/[{,]\s*'[^']*'\s*:/.test(e)||/:\s*'[^']*'/.test(e)}apply(e){let r=e.replace(/([{,]\s*)'([^']+)'(\s*:)/g,'$1"$2"$3');return r=r.replace(/(:\s*)'([^']+)'(\s*[,}])/g,'$1"$2"$3'),r}};at.SingleQuoteStrategy=_y;var Dy=class extends Yn{constructor(){super(...arguments),this.name="UnquotedKeyRepair",this.description="Adds quotes to unquoted object keys"}canApply(e){return/[{,]\s*[a-zA-Z_$][a-zA-Z0-9_$]*\s*:/.test(e)}apply(e){return e.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*:)/g,'$1"$2"$3')}};at.UnquotedKeyStrategy=Dy;var Ty=class extends Yn{constructor(){super(...arguments),this.name="CommentRemoval",this.description="Removes JavaScript-style comments"}canApply(e){return/\/\/.*$|\/\*[\s\S]*?\*\//m.test(e)}apply(e){let r=e.replace(/\/\/.*$/gm,"");return r=r.replace(/\/\*[\s\S]*?\*\//g,""),r}};at.CommentStrategy=Ty;var Lv=class extends Yn{constructor(){super(...arguments),this.name="UnescapedControlCharactersRepair",this.description="Escapes unescaped control characters (newlines, tabs, etc.) in JSON strings"}canApply(e){try{return JSON.parse(e),!1}catch(r){let n=r.message||"";return n.includes("control character")||n.includes("Bad control")||n.includes("Unexpected token")&&/[\n\r\t]/.test(e)}}apply(e){let r="",n=!1,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=o>0?e[o-1]:"";if(i){r+=s,i=!1;continue}if(s==="\\"&&n){r+=s,i=!0;continue}if(s==='"'&&a!=="\\"){n=!n,r+=s;continue}if(n)switch(s){case`
|
|
1766
1772
|
`:r+="\\n";break;case"\r":r+="\\r";break;case" ":r+="\\t";break;case"\b":r+="\\b";break;case"\f":r+="\\f";break;default:let c=s.charCodeAt(0);c<32?r+="\\u"+("0000"+c.toString(16)).slice(-4):r+=s}else r+=s}return r}},Pv=class extends Yn{constructor(){super(...arguments),this.name="TrailingCharactersRepair",this.description="Removes trailing characters after valid JSON structure"}canApply(e){let r=e.trim();if(!r.startsWith("{")&&!r.startsWith("["))return!1;let n=0,i=0,o=!1,s=!1;for(let a=0;a<r.length;a++){let c=r[a];if(o)s?s=!1:c==="\\"?s=!0:c==='"'&&(o=!1);else if(c==='"')o=!0;else if(c==="{")n++;else if(c==="}"){if(n--,n===0&&i===0&&a>0&&a<r.length-1)return!0}else if(c==="[")i++;else if(c==="]"&&(i--,i===0&&n===0&&a>0&&a<r.length-1))return!0}return!1}apply(e){let r=e.trim(),n=0,i=0,o=!1,s=!1,a=-1;for(let c=0;c<r.length;c++){let u=r[c];if(o)s?s=!1:u==="\\"?s=!0:u==='"'&&(o=!1);else if(u==='"')o=!0;else if(u==="{")n++;else if(u==="}"){if(n--,n===0&&i===0&&c>0){a=c;break}}else if(u==="[")i++;else if(u==="]"&&(i--,i===0&&n===0&&c>0)){a=c;break}}return a>0&&a<r.length-1?r.substring(0,a+1):e}},Wu=class{constructor(e={}){this.strategies=[],this.repairLog=[],this.options={attemptRepair:!0,maxDepth:10,preserveStringsOnFailure:!1,logRepairs:!1,...e},this.initializeDefaultStrategies(),e.customStrategies&&this.strategies.push(...e.customStrategies)}initializeDefaultStrategies(){this.strategies=[new By,new _y,new Lv,new Pv,new Qy,new vy,new Dy,new Ty]}parse(e){let r=Date.now();this.repairLog=[];let n=e instanceof Buffer?e.toString("utf8"):String(e);try{return{success:!0,data:JSON.parse(n),metadata:{parseTime:Date.now()-r,strategiesApplied:[]}}}catch(s){if(!this.options.attemptRepair)return{success:!1,error:`JSON parse error: ${s}`,metadata:{parseTime:Date.now()-r}}}let i=n,o=[];for(let s of this.strategies)if(s.canApply(i)){let a=i;if(i=s.apply(i),a!==i){o.push(s.name),this.repairLog.push(s.description),this.options.logRepairs&&console.log(`Applied ${s.name}: ${s.description}`);try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}catch{}}}try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}catch(s){let a=this.aggressiveFallback(i);return a.success?{...a,repairs:[...this.repairLog,"Applied aggressive fallback"],metadata:{parseTime:Date.now()-r,strategiesApplied:[...o,"AggressiveFallback"]}}:{success:!1,error:`Failed to parse JSON after applying ${o.length} strategies: ${s}`,repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}}aggressiveFallback(e){try{let r=e.indexOf("{"),n=e.indexOf("[");if(r===-1&&n===-1)return{success:!1,error:"No JSON-like structure found"};let i=r===-1?n:n===-1?r:Math.min(r,n),o=e.substring(i);for(let a of this.strategies)a.canApply(o)&&(o=a.apply(o));return{success:!0,data:JSON.parse(o)}}catch(r){return{success:!1,error:`Aggressive fallback failed: ${r}`}}}addStrategy(e){this.strategies.push(e)}removeStrategy(e){this.strategies=this.strategies.filter(r=>r.name!==e)}getStrategies(){return this.strategies.map(e=>e.name)}};at.ResilientJsonParser=Wu;var CG=new Wu;function tke(t,e){return(e?new Wu(e):CG).parse(t)}function rke(t){let e=CG.parse(t);if(e.success)return e.repairs&&e.repairs.length>0&&console.log("JSON parsed with repairs:",e.repairs),e.data;throw new Error(`Failed to parse JSON: ${e.error}`)}function nke(t){try{return JSON.parse(t),!0}catch{return!1}}function ike(t,e=2){return JSON.stringify(t,null,e)}function oke(t){let r=new Wu().parse(t);if(r.success)return JSON.stringify(r.data);throw new Error("Cannot minify invalid JSON")}});var ur=m(K=>{"use strict";var ske=K&&K.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),le=K&&K.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ske(e,t,r)};Object.defineProperty(K,"__esModule",{value:!0});K.SSELogSubscriptionManager=K.SuperglueHttpError=K.SuperglueClient=void 0;le(Mk(),K);le(tM(),K);le(pM(),K);le(hM(),K);le(IM(),K);le(CM(),K);le(SM(),K);le(bd(),K);le(nx(),K);le(ix(),K);le(ox(),K);le(sx(),K);le(mb(),K);le(cx(),K);le(dx(),K);le(Ax(),K);le(px(),K);le(Eb(),K);le(hx(),K);le(mx(),K);le(yx(),K);le(Ix(),K);le(cp(),K);le(bx(),K);le(Sx(),K);le(Bx(),K);le(Qx(),K);le(Dx(),K);le(Tx(),K);le(Ux(),K);le(xx(),K);le(Px(),K);le(rb(),K);le(Jx(),K);le(Zx(),K);le(zh(),K);le(lL(),K);le(gL(),K);le(mL(),K);le(qb(),K);le(CL(),K);le(bL(),K);le(QL(),K);le(_L(),K);le(dr(),K);le(ln(),K);le(DL(),K);le(TL(),K);le(og(),K);le(Lc(),K);le(Xl(),K);var SG=IG();Object.defineProperty(K,"SuperglueClient",{enumerable:!0,get:function(){return SG.SuperglueClient}});Object.defineProperty(K,"SuperglueHttpError",{enumerable:!0,get:function(){return SG.SuperglueHttpError}});var ake=Yb();Object.defineProperty(K,"SSELogSubscriptionManager",{enumerable:!0,get:function(){return ake.SSELogSubscriptionManager}});le(bG(),K)});var fE=require("commander");var Br=pe(require("fs")),QG=pe(require("os")),Jo=pe(require("path")),GA=pe(ur()),wG=new Set(["runner","builder","admin"]),BG={output:{mode:"stdout",directory:".superglue/output"},preset:"admin"};function Wo(t){let e=Jo.join(process.cwd(),".superglue"),r=QG.homedir();if(!r)return e;let n=Jo.join(r,".superglue");return t===!0?e:t===!1?n:Br.existsSync(Jo.join(e,"config.json"))?e:n}function Fv(t){return Jo.join(Wo(t),"config.json")}function Ry(t){let e=Fv(t);if(!Br.existsSync(e))return{};try{return JSON.parse(Br.readFileSync(e,"utf-8"))}catch{return{}}}function Zu(t){let e=Ry(),r=t.apiKey||(0,GA.readProcessEnvironmentValue)("SUPERGLUE_API_KEY")||e.apiKey||"",n=t.endpoint||(0,GA.readProcessEnvironmentValue)("SUPERGLUE_API_ENDPOINT")||e.endpoint||"https://api.superglue.cloud",i=(0,GA.readProcessEnvironmentValue)("SUPERGLUE_WEB_ENDPOINT")||e.webEndpoint||n.replace(/:3002\b/,":3001").replace(/api\.superglue/,"app.superglue"),o=(0,GA.readProcessEnvironmentValue)("SUPERGLUE_CLI_PRESET"),s=o&&wG.has(o)?o:e.preset&&wG.has(e.preset)?e.preset:"admin";return{...BG,...e,apiKey:r,endpoint:n,webEndpoint:i,preset:s,output:{...BG.output,...e.output}}}function ky(t,e){let r=Wo(e);Br.existsSync(r)||Br.mkdirSync(r,{recursive:!0}),Br.writeFileSync(Jo.join(r,"config.json"),JSON.stringify(t,null,2)+`
|
|
1767
|
-
`,{mode:384})}function Ny(t,e){let r=Jo.join(Wo(e),"drafts");if(Br.existsSync(r)||Br.mkdirSync(r,{recursive:!0}),t.output.mode==="stdout+file"){let n=Jo.resolve(t.output.directory);Br.existsSync(n)||Br.mkdirSync(n,{recursive:!0})}}var Yv=pe(ur());var $v=pe(require("readline"));var DG=require("child_process"),TG=require("util");var vG={name:"@superglue/cli",version:"1.1.
|
|
1773
|
+
`,{mode:384})}function Ny(t,e){let r=Jo.join(Wo(e),"drafts");if(Br.existsSync(r)||Br.mkdirSync(r,{recursive:!0}),t.output.mode==="stdout+file"){let n=Jo.resolve(t.output.directory);Br.existsSync(n)||Br.mkdirSync(n,{recursive:!0})}}var Yv=pe(ur());var $v=pe(require("readline"));var DG=require("child_process"),TG=require("util");var vG={name:"@superglue/cli",version:"1.1.176",bin:{sg:"./dist/cli.js"},files:[".claude-plugin/","dist/","skills/","LICENSE"],dependencies:{commander:"15.0.0-0","fast-json-patch":"3.1.1"},devDependencies:{"@superglue/shared":"file:../shared","@types/node":"25.5.0",tsup:"8.5.1",typescript:"5.8.3"},scripts:{build:"tsup && (cp -r skills dist/ 2>/dev/null || true)",dev:"tsup --watch","type-check":"tsc --noEmit",prepublishOnly:"npm run build"},publishConfig:{access:"public"}};var uke=(0,TG.promisify)(DG.exec),lr=vG.version;function _G(t){let e=t.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:t}}function Uy(t,e){let r=t.split("."),n=e.split("."),i=Math.max(r.length,n.length);for(let o=0;o<i;o++){let s=_G(r[o]||"0"),a=_G(n[o]||"0");if(s.numeric<a.numeric)return-1;if(s.numeric>a.numeric||s.prerelease===null&&a.prerelease!==null)return 1;if(s.prerelease!==null&&a.prerelease===null)return-1;if(s.prerelease!==null&&a.prerelease!==null){if(s.prerelease<a.prerelease)return-1;if(s.prerelease>a.prerelease)return 1}}return 0}async function My(){try{let t=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return t.ok&&(await t.json()).version||null}catch{return null}}var Oy=null;function RG(){re()&&(Oy=My())}async function kG(){if(!(!re()||!Oy)){try{let t=new Promise(r=>{setTimeout(()=>r(null),2e3).unref()}),e=await Promise.race([Oy,t]);e&&Uy(lr,e)<0&&(console.error(""),console.error(`${y.cyan}${y.bold} Update available: ${lr} \u2192 ${e}${y.reset}`),console.error(`${y.cyan} Run ${y.bold}sg update${y.reset}${y.cyan} to upgrade${y.reset}`),console.error(""))}catch{}Oy=null}}async function NG(){let t=await My();if(!t)return{success:!1,message:"Could not fetch latest version from npm"};if(Uy(lr,t)>=0)return{success:!0,message:`Already on latest version (${lr})`};try{return await uke("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${lr} to ${t}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var re=()=>process.argv.includes("--table")&&process.stdout.isTTY,Qr=()=>process.argv.includes("--full"),y={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m"};function OG(t,e){let r=e||t;return`\x1B]8;;${t}\x07${y.underline}${y.cyan}${r}${y.reset}\x1B]8;;\x07`}function UG(){if(!re())return;let t=y.reset,e=y.dim,r="\x1B[47;30m",n=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),n.forEach(i=>{let o=i.search(/\S/),s=i.length-[...i].reverse().join("").search(/\S/)-1;if(o===-1)return console.log(" "+i);let a=i.slice(0,o),c=i.slice(o,s+1).split("").map(l=>l===" "?" ":"\u2588").join(""),u=i.slice(s+1);console.log(` ${a}${r}${c}${t}${u}`)}),console.log(` ${e} CLI v${lr}${t}`),console.log("")}function it(t){if(!re())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],r=0,n=t,i=()=>process.stdout.write("\r\x1B[2K"),o=()=>{process.stdout.write(`\r ${y.cyan}${e[r++%e.length]}${y.reset} ${n}`)},s=setInterval(o,80);return{update:a=>{n=a},log:a=>{i(),console.log(` ${y.dim}\u2502${y.reset} ${a}`),o()},stop:a=>{clearInterval(s),i(),a&&console.log(` ${a}`)}}}function W(t){re()?xy(t):console.log(JSON.stringify(t,null,2))}function we(t,e){re()?(console.log(` ${y.green}\u2713${y.reset} ${t}`),e&&xy(e,4)):console.log(JSON.stringify({success:!0,message:t,...e&&typeof e=="object"?e:{data:e}}))}function _(t,e){re()?(console.error(` ${y.red}\u2717${y.reset} ${t}`),e&&xy(e,4)):console.error(JSON.stringify({success:!1,error:t,details:e}))}function MG(t){re()&&console.log(` ${y.yellow}\u26A0${y.reset} ${t}`)}function Xt(t){re()&&console.log(` ${y.dim}${t}${y.reset}`)}function Zo(t){re()&&(console.log(`
|
|
1768
1774
|
${y.bold}${y.cyan}${t}${y.reset}`),console.log(` ${y.dim}${"\u2500".repeat(t.length)}${y.reset}`))}function vr(t,e,r){if(!re()){console.log(JSON.stringify({success:!0,total:r?.total??t.length,items:t}));return}if(t.length===0){console.log(`
|
|
1769
1775
|
${y.dim}0 results${y.reset}
|
|
1770
1776
|
`);return}let n=e||Object.keys(t[0]),i=Qr()?1/0:60,o=n.map(l=>Math.min(i,Math.max(l.length,...t.map(d=>String(d[l]??"").replace(/[\n\r]+/g," ").trim().length))));console.log("");let s=n.map((l,d)=>`${y.bold}${y.cyan}${l.toUpperCase().padEnd(o[d])}${y.reset}`).join(" ");console.log(` ${s}`);let a=o.map(l=>`${y.dim}${"\u2500".repeat(l)}${y.reset}`).join(`${y.dim}\u2500\u2500${y.reset}`);console.log(` ${a}`);for(let l of t){let d=n.map((A,p)=>{let h=String(l[A]??"").replace(/[\n\r]+/g," ").trim();if(h.length>i){let S=`\u2026 (${h.length})`;h=h.slice(0,Math.max(0,i-S.length))+`${y.dim}${S}${y.reset}`}return A==="status"?`${{success:y.green,running:y.yellow,failed:y.red,aborted:y.red,error:y.red,pending:y.dim}[h.toLowerCase()]||""}${h.padEnd(o[p])}${y.reset}`:h.padEnd(o[p])}).join(" ");console.log(` ${d}`)}let c=r?.total??t.length,u=c===t.length?`${t.length} result${t.length===1?"":"s"}`:`${t.length} of ${c} result${c===1?"":"s"}`;console.log(`
|
|
@@ -40,17 +40,35 @@ The step logs in with the system's NetSuite OAuth token, the same one the REST s
|
|
|
40
40
|
|
|
41
41
|
## Operations
|
|
42
42
|
|
|
43
|
-
| Operation | Inputs | Result
|
|
44
|
-
| --------------- | ----------------------------------------------------------- |
|
|
45
|
-
| `listObjects` | optional `objectTypes` (array), `scriptIdContains` | Custom objects in the account: type and script ID
|
|
46
|
-
| `importObjects` | `objectType`, `scriptIds` (array) | `files`:
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
43
|
+
| Operation | Inputs | Result |
|
|
44
|
+
| --------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
45
|
+
| `listObjects` | optional `objectTypes` (array), `scriptIdContains` | Custom objects in the account: type and script ID |
|
|
46
|
+
| `importObjects` | `objectType`, `scriptIds` (array) | `files`: object XML and referenced SuiteScript source; `data` holds import results |
|
|
47
|
+
| `listFiles` | optional `folderPath` (default `/SuiteScripts`) | `data`: array of File Cabinet paths |
|
|
48
|
+
| `importFiles` | `filePaths` (array of File Cabinet paths) | `files`: project paths to UTF-8 text; `data.results`: per-file status |
|
|
49
|
+
| `validate` | `files` | NetSuite's validation of the project. Changes nothing. |
|
|
50
|
+
| `preview` | `files` | The changes a deploy would make. Changes nothing. |
|
|
51
|
+
| `deploy` | `files`, step `modify: true` | Applies the project to the account |
|
|
52
|
+
| `callRestlet` | `scriptId`, `deployId`, optional `method`, `params`, `body` | The JSON response of the RESTlet |
|
|
51
53
|
|
|
52
54
|
A failed operation fails the step with NetSuite's error messages. `importObjects` succeeds as long as NetSuite answers: each object that could not be exported is listed in `data.failedImports` with NetSuite's message, and `files` holds only the exported ones. Objects locked by an installed bundle or SuiteApp fail with "You cannot download the XML file for this object because it is locked", and some workflows fail with "Inconsistent workflow data". `listObjects` does not show which objects are locked; `appId` is `null` for them too. When an import returns no files, pick another object of the same type.
|
|
53
55
|
|
|
56
|
+
`importObjects` also imports each object's `<scriptfile>` reference under `FileCabinet/SuiteScripts/`. Check `data.successfulImports[].referencedFileImportResult.failedImports` for missing source files. Module dependencies inside JavaScript are not imported automatically; retrieve them with `importFiles`.
|
|
57
|
+
|
|
58
|
+
### Reading existing scripts
|
|
59
|
+
|
|
60
|
+
Use `listFiles` and `importFiles` to inspect existing source without deploying a RESTlet. Paths are case-sensitive File Cabinet paths, not project paths:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{ "operation": "listFiles", "folderPath": "/SuiteScripts" }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{ "operation": "importFiles", "filePaths": ["/SuiteScripts/example.js"] }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The imported source is at `files["FileCabinet/SuiteScripts/example.js"]`. Imports return UTF-8 text; invalid UTF-8 fails the step. Supported roots are `/SuiteScripts`, `/Templates/E-mail Templates`, `/Templates/Marketing Templates`, and `/Web Site Hosting Files`. SuiteApp files cannot be imported. Check every `data.results[]` entry: `loaded: false` includes the failure in `message`, even when the operation succeeds.
|
|
71
|
+
|
|
54
72
|
## Project Files
|
|
55
73
|
|
|
56
74
|
`files` maps a project path to the file content. Paths are relative and must stay inside the project.
|
package/package.json
CHANGED
|
@@ -40,17 +40,35 @@ The step logs in with the system's NetSuite OAuth token, the same one the REST s
|
|
|
40
40
|
|
|
41
41
|
## Operations
|
|
42
42
|
|
|
43
|
-
| Operation | Inputs | Result
|
|
44
|
-
| --------------- | ----------------------------------------------------------- |
|
|
45
|
-
| `listObjects` | optional `objectTypes` (array), `scriptIdContains` | Custom objects in the account: type and script ID
|
|
46
|
-
| `importObjects` | `objectType`, `scriptIds` (array) | `files`:
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
43
|
+
| Operation | Inputs | Result |
|
|
44
|
+
| --------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
45
|
+
| `listObjects` | optional `objectTypes` (array), `scriptIdContains` | Custom objects in the account: type and script ID |
|
|
46
|
+
| `importObjects` | `objectType`, `scriptIds` (array) | `files`: object XML and referenced SuiteScript source; `data` holds import results |
|
|
47
|
+
| `listFiles` | optional `folderPath` (default `/SuiteScripts`) | `data`: array of File Cabinet paths |
|
|
48
|
+
| `importFiles` | `filePaths` (array of File Cabinet paths) | `files`: project paths to UTF-8 text; `data.results`: per-file status |
|
|
49
|
+
| `validate` | `files` | NetSuite's validation of the project. Changes nothing. |
|
|
50
|
+
| `preview` | `files` | The changes a deploy would make. Changes nothing. |
|
|
51
|
+
| `deploy` | `files`, step `modify: true` | Applies the project to the account |
|
|
52
|
+
| `callRestlet` | `scriptId`, `deployId`, optional `method`, `params`, `body` | The JSON response of the RESTlet |
|
|
51
53
|
|
|
52
54
|
A failed operation fails the step with NetSuite's error messages. `importObjects` succeeds as long as NetSuite answers: each object that could not be exported is listed in `data.failedImports` with NetSuite's message, and `files` holds only the exported ones. Objects locked by an installed bundle or SuiteApp fail with "You cannot download the XML file for this object because it is locked", and some workflows fail with "Inconsistent workflow data". `listObjects` does not show which objects are locked; `appId` is `null` for them too. When an import returns no files, pick another object of the same type.
|
|
53
55
|
|
|
56
|
+
`importObjects` also imports each object's `<scriptfile>` reference under `FileCabinet/SuiteScripts/`. Check `data.successfulImports[].referencedFileImportResult.failedImports` for missing source files. Module dependencies inside JavaScript are not imported automatically; retrieve them with `importFiles`.
|
|
57
|
+
|
|
58
|
+
### Reading existing scripts
|
|
59
|
+
|
|
60
|
+
Use `listFiles` and `importFiles` to inspect existing source without deploying a RESTlet. Paths are case-sensitive File Cabinet paths, not project paths:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{ "operation": "listFiles", "folderPath": "/SuiteScripts" }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{ "operation": "importFiles", "filePaths": ["/SuiteScripts/example.js"] }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The imported source is at `files["FileCabinet/SuiteScripts/example.js"]`. Imports return UTF-8 text; invalid UTF-8 fails the step. Supported roots are `/SuiteScripts`, `/Templates/E-mail Templates`, `/Templates/Marketing Templates`, and `/Web Site Hosting Files`. SuiteApp files cannot be imported. Check every `data.results[]` entry: `loaded: false` includes the failure in `message`, even when the operation succeeds.
|
|
71
|
+
|
|
54
72
|
## Project Files
|
|
55
73
|
|
|
56
74
|
`files` maps a project path to the file content. Paths are relative and must stay inside the project.
|