PageSourceSearch

https://www.rocelec.fr/webruntime/component/2e18f25caaabd15224694d…/fr/force/ldsWebruntimeOneStoreInit_cmp

js rocelec.fr collected 2026-10-04 07:38:39 UTC 125,527 bytes, 242 lines download raw bytes

1(function() { LWR.define("force/luvioTypeNormalization1",["exports"],function(e){
2/*!
3   * Copyright (c) 2022, Salesforce, Inc.,
4   * All rights reserved.
5   * For full license text, see the LICENSE.txt file
6   */
7const{create:t,freeze:n,keys:r,entries:i}=Object,{isArray:a}=Array,{stringify:s,parse:o}=JSON;class c{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}}class u{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}}const l=e=>new c(e),p=e=>new u(e);function h(e,t){if(void 0===e)return void 0===t;if(null===e)return null===t;if(null===t)return null===e;if(a(e)){if(!a(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!h(e[n],t[n]))return!1;return!0}if("object"==typeof e){if("object"!=typeof t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;++r){const i=n[r];if(!h(e[i],t[i]))return!1}return!0}return e===t}function y(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===e)return;if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return s(e);let t,n;if(a(e)){for(n="[",t=0;t<e.length;t++)t&&(n+=","),n+=y(e[t])||"null";return n+"]"}if(null===e)return"null";const i=r(e).sort();for(n="",t=0;t<i.length;t++){const r=i[t],a=y(e[r]);a&&(n&&(n+=","),n+=s(r)+":"+a)}return"{"+n+"}"}
8/*!
9   * Copyright (c) 2022, Salesforce, Inc.,
10   * All rights reserved.
11   * For full license text, see the LICENSE.txt file
12   */function d(e,t){return e.metadata.type.namespace===t.namespace&&e.metadata.type.name===t.typeName}class m{constructor(e){this.services=e}get cacheMetadata(){return{cacheControl:{...this.cacheControl},type:{namespace:this.namespace,name:this.typeName}}}buildKey(e){return`${this.namespace}::${this.typeName}(${y(e)})`}write(e,t){var n;const r=this.buildKey(this.buildKeyParams(t)),i=null==(n=e.get(r))?void 0:n.value,a=this.normalizeData(e,{...t,existingNormalizedData:i});return a.isErr()?p(a.error):(e.set(r,{value:a.value,metadata:this.cacheMetadata}),l({type:"link",linkedKey:r}))}validateEntry(e){return d(e,this)?l(void 0):p([{type:"incorrectType",expectedType:this.typeName,actualType:e.metadata.type.name}])}query(e,t){return this.read(e,{...t,normalizedData:{type:"link",linkedKey:this.buildKey(t.keyParams)}})}read(e,t){return this.denormalize(e,{...t,key:t.normalizedData.linkedKey})}denormalize(e,t){const n=e.get(t.key,{copy:!1});if(n){const r=this.validateEntry(n);if(r.isErr())return p([...r.error]);const i=n.value;return this.denormalizeData(e,{...t,normalizedData:i})}return p([this.buildMissingDataError()])}equals(e,t){return h(e,t)}buildMissingDataError(){return{type:"missingData",typeName:this.typeName,namespace:this.namespace,data:void 0}}}class f extends m{}function v(e,t,n,r){return`${e}::${t}(${r.map(e=>{const t=n[e];return`${a(t)?t.join():t}`}).join("|")})`}function b(e,t,n,r){const i=n.map(n=>{const i=r.map(e=>{if(!(e in n))return"[^|]*?";const t=n[e];return`(?:${(a(t)?t.join():String(t)).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`}).join("\\|");return`^${e}::${t}\\((?:${i})\\)$`});return new RegExp(`^(?:${i.join("|")})$`)}e.FlattenedKeySelfIdentifiableTypeRepository=class extends f{constructor(e){super(e),this.services=e}async invalidate(e){return this.setupCacheOperation(e,"invalidate","cacheInvalidation")}collectInstrumentation(e,t){if(this.services.instrumentation){const n=this.services.instrumentation.metrics.getMeter("onestore"),r={...this.instrumentationAttributes,namespace:this.namespace,typeName:this.typeName};n.createCounter(`type.${t}.count`).add(1,r),n.createHistogram(`type.${t}.duration`).record(e,r)}}async evict(e){return this.setupCacheOperation(e,"evict","cacheEviction")}async setupCacheOperation(e,t,n){const r=this.services.instrumentation?this.services.instrumentation.currentTimeMs():0;return this.runCacheOperation(e,t,n).then(()=>{if(this.services.instrumentation){const e=this.services.instrumentation.currentTimeMs()-r;this.collectInstrumentation(e,t)}})}async runCacheOperation(e,t,n){const r=b(this.namespace,this.typeName,e,this.keySchema),i=new Set;for await(const e of this.services.cacheController.findAndModify({key:{$regex:r}},{type:t}))i.add(e);i.size>0&&await this.services.pubSub.publish({type:n,data:i})}buildKey(e){return v(this.namespace,this.typeName,e,this.keySchema)}},e.IdentifiableTypeRepository=m,e.SelfIdentifiableTypeRepository=f,e.buildNamespacedTypeKey=v,e.buildReadWriteResult=function(e,t){return t.length>0?p(t):l(e)},e.buildRegexForNamespacedKeys=b,e.denormalizeUnionRepresentation=function(e,t){return t[e.discriminator](e.data)},e.extractReadWriteData=function(e,t){if(e.isOk())return e.value;t.push(...e.error)},e.isCacheEntryForType=d,e.normalizeUnionRepresentation=function(e,t){for(const n of Object.keys(t)){const r=t[n];if(r.test(e))return{discriminator:n,data:r.normalize(e)}}throw new Error("No matching union member found")}
12,Object.defineProperty(e,"__esModule",{value:!0})});
13})();(function() { LWR.define("force/luvioOnestoreGraphqlParser",["exports"],function(e){
14/*!
15   * Copyright (c) 2022, Salesforce, Inc.,
16   * All rights reserved.
17   * For full license text, see the LICENSE.txt file
18   */
19function t(e,t){if(!Boolean(e))throw new Error(t)}function n(e){return i(e,[])}function i(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:i(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,s=[];for(let r=0;r<n;++r)s.push(i(e[r],t));1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`);return"["+s.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map(([e,n])=>e+": "+i(n,t));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const r=globalThis.process&&!0?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var i;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(i=e.constructor)||void 0===i?void 0:i.name)){const t=n(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class s{constructor(e,i="GraphQL request",r={line:1,column:1}){"string"==typeof e||t(!1,`Body must be a string. Received: ${n(e)}.`),this.body=e,this.name=i,this.locationOffset=r,this.locationOffset.line>0||t(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||t(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function o(e){return r(e,s)}function a(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const c=/\r\n|[\n\r]/g;function u(e,t){let n=0,i=1;for(const r of e.body.matchAll(c)){if("number"==typeof r.index||a(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function l(e){return p(e.source,u(e.source,e.start))}function p(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=1===t.line?n:0,c=t.column+a,u=`${e.name}:${o}:${c}\n`,l=i.split(/\r\n|[\n\r]/g),p=l[r];if(p.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return u+d([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return u+d([[o-1+" |",l[r-1]],[`${o} |`,p],["|","^".padStart(c)],[`${o+1} |`,l[r+1]]])}function d(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}var h,f,E;e.Kind=void 0,(h=e.Kind||(e.Kind={})).NAME="Name",h.DOCUMENT="Document",h.OPERATION_DEFINITION="OperationDefinition",h.VARIABLE_DEFINITION="VariableDefinition",h.SELECTION_SET="SelectionSet",h.FIELD="Field",h.ARGUMENT="Argument",h.FRAGMENT_SPREAD="FragmentSpread",h.INLINE_FRAGMENT="InlineFragment",h.FRAGMENT_DEFINITION="FragmentDefinition",h.VARIABLE="Variable",h.INT="IntValue",h.FLOAT="FloatValue",h.STRING="Str
19ingValue",h.BOOLEAN="BooleanValue",h.NULL="NullValue",h.ENUM="EnumValue",h.LIST="ListValue",h.OBJECT="ObjectValue",h.OBJECT_FIELD="ObjectField",h.DIRECTIVE="Directive",h.NAMED_TYPE="NamedType",h.LIST_TYPE="ListType",h.NON_NULL_TYPE="NonNullType",h.SCHEMA_DEFINITION="SchemaDefinition",h.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",h.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",h.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",h.FIELD_DEFINITION="FieldDefinition",h.INPUT_VALUE_DEFINITION="InputValueDefinition",h.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",h.UNION_TYPE_DEFINITION="UnionTypeDefinition",h.ENUM_TYPE_DEFINITION="EnumTypeDefinition",h.ENUM_VALUE_DEFINITION="EnumValueDefinition",h.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",h.DIRECTIVE_DEFINITION="DirectiveDefinition",h.SCHEMA_EXTENSION="SchemaExtension",h.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",h.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",h.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",h.UNION_TYPE_EXTENSION="UnionTypeExtension",h.ENUM_TYPE_EXTENSION="EnumTypeExtension",h.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",(E=f||(f={})).SOF="<SOF>",E.EOF="<EOF>",E.BANG="!",E.DOLLAR="$",E.AMP="&",E.PAREN_L="(",E.PAREN_R=")",E.SPREAD="...",E.COLON=":",E.EQUALS="=",E.AT="@",E.BRACKET_L="[",E.BRACKET_R="]",E.BRACE_L="{",E.PIPE="|",E.BRACE_R="}",E.NAME="Name",E.INT="Int",E.FLOAT="Float",E.STRING="String",E.BLOCK_STRING="BlockString",E.COMMENT="Comment";class m extends Error{constructor(e,...t){var n,i,r;const{nodes:s,source:o,positions:a,path:c,originalError:l,extensions:p}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=l?l:void 0,this.nodes=T(Array.isArray(s)?s:s?[s]:void 0);const d=T(null===(n=this.nodes)||void 0===n?void 0:n.map(e=>e.loc).filter(e=>null!=e));this.source=null!=o?o:null==d||null===(i=d[0])||void 0===i?void 0:i.source,this.positions=null!=a?a:null==d?void 0:d.map(e=>e.start),this.locations=a&&o?a.map(e=>u(o,e)):null==d?void 0:d.map(e=>u(e.source,e.start));const h="object"==typeof(f=null==l?void 0:l.extensions)&&null!==f?null==l?void 0:l.extensions:void 0;var f;this.extensions=null!==(r=null!=p?p:h)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=l&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,m):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+l(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+p(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function T(e){return void 0===e||0===e.length?void 0:e}function v(e,t,n){return new m(`Syntax Error: ${n}`,{source:e,positions:[t]})}class N{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class I{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const y={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],Float
19Value:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},O=new Set(Object.keys(y));function A(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&O.has(t)}var D,x,_,k;function g(e){return 9===e||32===e}function S(e){return e>=48&&e<=57}function C(e){return e>=97&&e<=122||e>=65&&e<=90}function L(e){return C(e)||95===e}function R(e){return C(e)||S(e)||95===e}function b(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let t=0;t<e.length;++t){var s;const o=e[t],a=F(o);a!==o.length&&(i=null!==(s=i)&&void 0!==s?s:t,r=t,0!==t&&a<n&&(n=a))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=i)&&void 0!==t?t:0,r+1)}function F(e){let t=0;for(;t<e.length&&g(e.charCodeAt(t));)++t;return t}function w(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every(e=>0===e.length||g(e.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,c=e.endsWith("\\"),u=a||c,l=!(null!=t&&t.minimize)&&(!r||e.length>70||u||s||o);let p="";const d=r&&g(e.charCodeAt(0));return(l&&!d||s)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}(x=D||(D={})).QUERY="query",x.MUTATION="mutation",x.SUBSCRIPTION="subscription";class P{constructor(e){const t=new I(f.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==f.EOF)do{if(e.next)e=e.next;else{const t=G(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===f.COMMENT);return e}}function K(e){return e===f.BANG||e===f.DOLLAR||e===f.AMP||e===f.PAREN_L||e===f.PAREN_R||e===f.SPREAD||e===f.COLON||e===f.EQUALS||e===f.AT||e===f.BRACKET_L||e===f.BRACKET_R||e===f.BRACE_L||e===f.PIPE||e===f.BRACE_R}function M(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function U(e,t){return V(e.charCodeAt(t))&&B(e.charCodeAt(t+1))}function V(e){return e>=55296&&e<=56319}function B(e){return e>=56320&&e<=57343}function j(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return f.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function $(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new I(t,n,i,s,o,r)}function G(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const t=n.charCodeAt(r);switch(t){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:10===n.charCodeAt(r+1)?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Y(e,r);case 33:return $(e,f.BANG,r,r+1);case 36:return $(e,f.DOLLAR,r,r+1);case 38:return $(e,f.AMP,r,r+1);case 40:return $(e,f.PAREN_L,r,r+1);case 41:return $(e,f.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return $(e,f.SPREAD,r,r+3);break;case 58:return $(e,f.COLON,r,r+1);case 61:return $(e,f.EQUALS,r,r+1);case 64:return $(e,f.AT,r,r+1);case 91:return $(e,f.BRACKET_L,r,r+1);case 93:return $(e,f.BRACKET_R,r,r+1);case 123:return $(e,f.BRACE_L,r,r+1);case 124:return $(e,f.PIPE,r,r+1);case 125:return $(e,f.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?ee(e,r):Q(e,r)}if(S(t)||45===t)return q(e,r,t);if(L(t))return te(e,r);
vendor: 10,081 bytes, line 19
19throw v(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":M(t)||U(n,r)?`Unexpected character: ${j(e,r)}.`:`Invalid character: ${j(e,r)}.`)}return $(e,f.EOF,i,i)}function Y(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(10===e||13===e)break;if(M(e))++r;else{if(!U(n,r))break;r+=2}}return $(e,f.COMMENT,t,r,n.slice(t+1,r))}function q(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),S(s))throw v(e.source,r,`Invalid number, unexpected digit after 0: ${j(e,r)}.`)}else r=J(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=J(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=J(e,r,s),s=i.charCodeAt(r)),46===s||L(s))throw v(e.source,r,`Invalid number, expected digit but got: ${j(e,r)}.`);return $(e,o?f.FLOAT:f.INT,t,r,i.slice(t,r))}function J(e,t,n){if(!S(n))throw v(e.source,t,`Invalid number, expected digit but got: ${j(e,t)}.`);const i=e.source.body;let r=t+1;for(;S(i.charCodeAt(r));)++r;return r}function Q(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const i=n.charCodeAt(r);if(34===i)return o+=n.slice(s,r),$(e,f.STRING,t,r+1,o);if(92===i){o+=n.slice(s,r);const t=117===n.charCodeAt(r+1)?123===n.charCodeAt(r+2)?z(e,r):X(e,r):Z(e,r);o+=t.value,r+=t.size,s=r;continue}if(10===i||13===i)break;if(M(i))++r;else{if(!U(n,r))throw v(e.source,r,`Invalid character within String: ${j(e,r)}.`);r+=2}}throw v(e.source,r,"Unterminated string.")}function z(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const e=n.charCodeAt(t+r++);if(125===e){if(r<5||!M(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|W(e),i<0)break}throw v(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function X(e,t){const n=e.source.body,i=H(n,t+2);if(M(i))return{value:String.fromCodePoint(i),size:6};if(V(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=H(n,t+8);if(B(e))return{value:String.fromCodePoint(i,e),size:12}}throw v(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function H(e,t){return W(e.charCodeAt(t))<<12|W(e.charCodeAt(t+1))<<8|W(e.charCodeAt(t+2))<<4|W(e.charCodeAt(t+3))}function W(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Z(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw v(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ee(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,a="";const c=[];for(;s<i;){const i=n.charCodeAt(s);if(34===i&&34===n.charCodeAt(s+1)&&34===n.charCodeAt(s+2)){a+=n.slice(o,s),c.push(a);const i=$(e,f.BLOCK_STRING,t,s+3,b(c).join("\n"));return e.line+=c.length-1,e.lineStart=r,i}if(92!==i||34!==n.charCodeAt(s+1)||34!==n.charCodeAt(s+2)||34!==n.charCodeAt(s+3))if(10!==i&&13!==i)if(M(i))++s;else{if(!U(n,s))throw v(e.source,s,`Invalid character within String: ${j(e,s)}.`);s+=2}else a+=n.slice(o,s),c.push(a),13===i&&10===n.charCodeAt(s+1)?s+=2:++s,a="",o=s,r=s;else a+=n.slice(o,s),o=s+1,s+=4}throw v(e.source,s,"Unterminated string.")}function te(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){if(!R(n.charCodeAt(r)))break;++r}return $(e,f.NAME,t,r,n.slice(t,r))}function ne(e,t){const n=new ie(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}(k=_||(_={})).QUERY="QUERY",k.MUTATION="MUTATION",k.SUBSCRIPTION="SUBSCRIPTION",k.FIELD="FIELD",k.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",k.FRAGMENT_SPREAD="FRAGMENT_SPREAD",k.INLINE_FRAGMENT="INLINE_FRAGMENT",k.VARIABLE_DEFINITION="VARIABLE_DEFINITION",k.SCHEMA="SCHEMA",k.SCALAR="SCALAR",k.OBJECT="OBJECT",k.FIELD_DEFINITION="FIELD_DEFINITION",k.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",k.INTERFACE="INTERFACE",k.UNION="UNION",k.ENUM="ENUM",k.ENUM_VALUE="ENUM_VALUE",k.INPUT_OBJECT="INPUT_OBJECT",k.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION";class ie{constructor(e,t={}){const n=o(e)?e:new s(e);this._lexer=new P(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(f.NAME);return this.node(t,{kind:e.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:e.Kind.DOCUMENT,definitions:this.many(f.SOF,this.parseDefinition,f.EOF)})}parseDefinition(){if(this.peek(f.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===f.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw v(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(f.BRACE_L))return this.node(t,{kind:e.Kind.OPERATION_DEFINITION,operation:D.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(f.NAME)&&(i=this.parseName()),this.node(t,{kind:e.Kind.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(f.NAME);switch(e.value){case"query":return D.QUERY;case"mutation":return D.MUTATION;case"subscription":return D.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(f.PAREN_L,this.parseVariableDefinition,f.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:e.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(f.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(f.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(f.DOLLAR),this.node(t,{kind:e.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:e.Kind.SELECTION_SET,selections:this.many(f.BRACE_L,this.parseSelection,f.BRACE_R)})}parseSelection(){return this.peek(f.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(f.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:e.Kind.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(f.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(f.PAREN_L,t,f.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(f.COLON),this.node(n,{kind:e.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(f.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(f.NAME)?this.node(t,{kind:e.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:e.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(t,{kind:e.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:e.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case f.BRACKET_L:return this.parseList(t);case f.BRACE_L:return this.parseObject(t);case f.INT:return this.advanceLexer(),this.node(n,{kind:e.Kind.INT,value:n.value});case f.FLOAT:return this.advanceLexer(),this.node(n,{kind:e.Kind.FLOAT,value:n.value});case f.STRING:case f.BLOCK_STRING:return this.parseStringLiteral();case f.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:e.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:e.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:e.Kind.NULL});default:return this.node(n,{kind:e.Kind.ENUM,value:n.value})}case f.DOLLAR:if(t){if(this.expectToken(f.DOLLAR),this._lexer.token.kind===f.NAME){const e=this._lexer.token.value;throw v(this._lexer.source,n.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(n)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:e.Kind.STRING,value:t.value,block:t.kind===f.BLOCK_STRING})}
19parseList(t){return this.node(this._lexer.token,{kind:e.Kind.LIST,values:this.any(f.BRACKET_L,()=>this.parseValueLiteral(t),f.BRACKET_R)})}parseObject(t){return this.node(this._lexer.token,{kind:e.Kind.OBJECT,fields:this.any(f.BRACE_L,()=>this.parseObjectField(t),f.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(f.COLON),this.node(n,{kind:e.Kind.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(e){const t=[];for(;this.peek(f.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(f.AT),this.node(n,{kind:e.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(f.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(f.BRACKET_R),n=this.node(t,{kind:e.Kind.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(f.BANG)?this.node(t,{kind:e.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:e.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(f.STRING)||this.peek(f.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(f.BRACE_L,this.parseOperationTypeDefinition,f.BRACE_R);return this.node(t,{kind:e.Kind.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(f.COLON);const i=this.parseNamedType();return this.node(t,{kind:e.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:e.Kind.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:e.Kind.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(f.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(f.BRACE_L,this.parseFieldDefinition,f.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(f.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:e.Kind.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(f.PAREN_L,this.parseInputValueDef,f.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(f.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(f.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:e.Kind.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:e.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:e.Kind.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(f.EQUALS)?this.delimitedMany(f.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:e.Kind.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(f.BRACE_L,this.parseEnumValueDefinition,f.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:e.Kind.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw v(this._lexer.source,this._lexer.token.start,`${re(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:e.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(f.BRACE_L,this.parseInputValueDef,f.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===f.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(f.BRACE_L,this.parseOperationTypeDefinition,f.BRACE_R);if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:e.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(t,{kind:e.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(0===i.length&&0===r.length&&0===s.length)throw this.unexpected();return this.node(t,{kind:e.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(0===i.length&&0===r.length&&0===s.length)throw this.unexpected();return this.node(t,{kind:e.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===i.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:e.Kind.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===i.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:e.Kind.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===i.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:e.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(f.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:e.Kind.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(f.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(_,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new N(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw v(this._lexer.source,t.start,`Expected ${se(e)}, found ${re(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==f.NAME||t.value!==e)throw v(this._lexer.source,t.start,`Expected "${e}", found ${re(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===f.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return v(this._lexer.source,t.start,`Unexpected ${re(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==f.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw v(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function re(e){const t=e.value;return se(e.kind)+(null!=t?` "${t}"`:"")}function se(e){return K(e)?`"${e}"`:e}const oe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ae(e){return ce[e.charCodeAt(0)]}const ce=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],ue=Object.freeze({});function le(i,r,s=y){const o=new Map;for(const t of Object.values(e.Kind))o.set(t,pe(r,t));let a,c,u,l=Array.isArray(i),p=[i],d=-1,h=[],f=i;const E=[],m=[];do{d++;const e=d===p.length,i=e&&0!==h.length;if(e){if(c=0===m.length?void 0:E[E.length-1],f=u,u=m.pop(),i)if(l){f=f.slice();let e=0;for(const[t,n]of h){const i=t-e;null===n?(f.splice(i,1),e++):f[i]=n}}else{f={...f};for(const[e,t]of h)f[e]=t}d=a.index,p=a.keys,h=a.edits,l=a.inArray,a=a.prev}else if(u){if(c=l?d:p[d],f=u[c],null==f)continue;E.push(c)}let I;if(!Array.isArray(f)){var T,v;A(f)||t(!1,`Invalid AST Node: ${n(f)}.`);const i=e?null===(T=o.get(f.kind))||void 0===T?void 0:T.leave:null===(v=o.get(f.kind))||void 0===v?void 0:v.enter;if(I=null==i?void 0:i.call(r,f,c,u,E,m),I===ue)break;
19if(!1===I){if(!e){E.pop();continue}}else if(void 0!==I&&(h.push([c,I]),!e)){if(!A(I)){E.pop();continue}f=I}}var N;if(void 0===I&&i&&h.push([c,f]),e)E.pop();else a={inArray:l,index:d,keys:p,edits:h,prev:a},l=Array.isArray(f),p=l?f:null!==(N=s[f.kind])&&void 0!==N?N:[],d=-1,h=[],u&&m.push(u),u=f}while(void 0!==a);return 0!==h.length?h[h.length-1][1]:i}function pe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}const de={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>he(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Ee("(",he(e.variableDefinitions,", "),")"),n=he([e.operation,he([e.name,t]),he(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+Ee(" = ",n)+Ee(" ",he(i," "))},SelectionSet:{leave:({selections:e})=>fe(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=Ee("",e,": ")+t;let o=s+Ee("(",he(n,", "),")");return o.length>80&&(o=s+Ee("(\n",me(he(n,"\n")),"\n)")),he([o,he(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Ee(" ",he(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>he(["...",Ee("on ",e),he(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${Ee("(",he(n,", "),")")} on ${t} ${Ee("",he(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?w(e):`"${e.replace(oe,ae)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+he(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+he(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Ee("(",he(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Ee("",e,"\n")+he(["schema",he(t," "),fe(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Ee("",e,"\n")+he(["scalar",t,he(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Ee("",e,"\n")+he(["type",t,Ee("implements ",he(n," & ")),he(i," "),fe(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>Ee("",e,"\n")+t+(Te(n)?Ee("(\n",me(he(n,"\n")),"\n)"):Ee("(",he(n,", "),")"))+": "+i+Ee(" ",he(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>Ee("",e,"\n")+he([t+": "+n,Ee("= ",i),he(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Ee("",e,"\n")+he(["interface",t,Ee("implements ",he(n," & ")),he(i," "),fe(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>Ee("",e,"\n")+he(["union",t,he(n," "),Ee("= ",he(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>Ee("",e,"\n")+he(["enum",t,he(n," "),fe(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Ee("",e,"\n")+he([t,he(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>Ee("",e,"\n")+he(["input",t,he(n," "),fe(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:r})=>Ee("",e,"\n")+"directive @"+t+(Te(n)?Ee("(\n",me(he(n,"\n")),"\n)"):Ee("(",he(n,", "),")"))+(i?" repeatable":"")+" on "+he(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>he(["extend schema",he(e," "),fe(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>he(["extend scalar",e,he(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>
19he(["extend type",e,Ee("implements ",he(t," & ")),he(n," "),fe(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>he(["extend interface",e,Ee("implements ",he(t," & ")),he(n," "),fe(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>he(["extend union",e,he(t," "),Ee("= ",he(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>he(["extend enum",e,he(t," "),fe(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>he(["extend input",e,he(t," "),fe(n)]," ")}};function he(e,t=""){var n;return null!==(n=null==e?void 0:e.filter(e=>e).join(t))&&void 0!==n?n:""}function fe(e){return Ee("{\n",me(he(e,"\n")),"\n}")}function Ee(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function me(e){return Ee("  ",e.replace(/\n/g,"\n  "))}function Te(e){var t;return null!==(t=null==e?void 0:e.some(e=>e.includes("\n")))&&void 0!==t&&t}const ve=new Map,Ne=new WeakMap;function Ie(e){return function(e){const t=o(e)?e:new s(e),n=t.body,i=new P(t);let r="",a=!1;for(;i.advance().kind!==f.EOF;){const e=i.token,t=e.kind,s=!K(e.kind);a&&(s||e.kind===f.SPREAD)&&(r+=" ");const o=n.slice(e.start,e.end);t===f.BLOCK_STRING?r+=w(e.value,{minimize:!0}):r+=o,a=s}return r}(e)}function ye(e){const t=new String;return function(e,t){Ne.set(t,e)}(e,t),t}function Oe(e){return ye({type:"error",error:{errors:[{message:e}]}})}const Ae=function(e){if("object"==typeof e&&null!==e)return Ne.get(e)};
20/*!
21   * Copyright (c) 2022, Salesforce, Inc.,
22   * All rights reserved.
23   * For full license text, see the LICENSE.txt file
24   */
25class De{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}}class xe{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}}const _e=e=>new De(e),ke=e=>new xe(e);function ge(t,n){const i=function(t,n){const i=t.definitions.filter(t=>t.kind===e.Kind.OPERATION_DEFINITION);if(0!==i.length)return 1!==i.length||n?n?i.find(e=>{var t;return(null==(t=e.name)?void 0:t.value)===n}):void 0:i[0]}(t.query,t.operationName);if(i){const e=i.operation;if(!n.acceptedOperations.includes(e)){const t=e.charAt(0).toUpperCase()+e.slice(1);throw new Error(`${t} operations are not supported in this context`)}}}e.astResolver=Ae,e.gql=function(e,...t){let n,i;if(!e)return Oe("Invalid query");if("string"==typeof e)n=e.trim(),i=[];else{const r=function(e,t){let n="";const i=[],r=t.length;for(let s=0;s<r;s++){const r=t[s];if(n+=e[s],"string"==typeof r||"number"==typeof r)n+=r;else{if("object"!=typeof r)return null;{const e=Ne.get(r);if(void 0===e||"error"===e.type)return null;for(const t of e.document.definitions)i.push(t)}}}return{operationString:n+e[r],fragments:i}}(e,t);if(null===r)return Oe("Invalid substitution");const{operationString:s,fragments:o}=r;n=s.trim(),i=o}if(0===n.length)return Oe("Invalid query");const r=function(e){var t;const n=Ie(e),i=ve.get(n);if(void 0!==i)return i;try{const t={type:"document",document:ne(e,{noLocation:!0})};return ve.set(n,t),t}catch(e){if(e instanceof m){const i={type:"error",error:{errors:[{message:e.message||"Failed to parse GraphQL document",locations:null==(t=e.locations)?void 0:t.map(e=>({line:e.line,column:e.column})),extensions:e.extensions}]}};return ve.set(n,i),i}throw e}}(n);if("error"===r.type)return ye(r);const s=r.document;return 0===i.length?ye({type:"document",document:s}):ye({type:"document",document:(o=s,a=i,a.forEach(e=>{o.definitions.push(e)}),o)});var o,a},e.parse=ne,e.print=function(e){return le(e,de)},e.resolveAndValidateGraphQLConfig=function(e,t){const n=e.query;if(null==n)return;const i=function(e,t,n){const i=function(e){if(null!=e)return Ae(e)}(e);if(void 0===i)throw new Error("Could not resolve AST. Did you parse the query with gql?");if("error"===i.type)return ke(i.error);const r=i.document;return ge({query:r,operationName:t},{acceptedOperations:(null==n?void 0:n.acceptedOperations)??["query"]}),_e(r)}(n,e.operationName,t);return i.isErr()?ke(i.error):_e({...e,query:i.value})},e.visit=le,Object.defineProperty(e,"__esModule",{value:!0})});
26})();(function() { LWR.define("force/luvioServiceProvisioner1",["exports"],function(e){
27/*!
28   * Copyright (c) 2022, Salesforce, Inc.,
29   * All rights reserved.
30   * For full license text, see the LICENSE.txt file
31   */
32function r(e){return t(e)?e.then(e=>e):{then:(t,o)=>{try{return r(t(e))}catch(o){return void 0===t?r(e):n(o)}}}}function n(e){return t(e)?e.then(e=>e):{then:(t,o)=>{if("function"==typeof o)try{return r(o(e))}catch(e){return n(e)}return n(e)}}}function t(e){return"function"==typeof(null==e?void 0:e.then)}
33/*!
34   * Copyright (c) 2022, Salesforce, Inc.,
35   * All rights reserved.
36   * For full license text, see the LICENSE.txt file
37   */
38function o(e,r){return e.type===r.type&&function(e,r){const n=e.split(".").map(e=>parseInt(e)),t=r.split(".").map(e=>parseInt(e));return n[0]===t[0]&&n[1]>=t[1]}(e.version,r.version)&&(void 0===r.tags||Object.keys(r.tags).every(n=>{var t;return(null==(t=e.tags)?void 0:t[n])===r.tags[n]}))}let i,s=new Promise(e=>i=e);function c(e){s=r(e),i(e)}function u(e){return n=>{const t={},i=[];for(const[r,s]of Object.entries(n)){const n=e.find(e=>o(e,s));n?t[r]=n.service:"optional"in s&&s.optional||i.push(r)}return r([t,i])}}e.buildDynamicServiceResolver=function(e){const n=e.map(e=>Object.assign({service:void 0},e));return e=>{const t={},i=[],s=[];return Object.entries(e).forEach(([e,r])=>{const c=n.find(e=>o(e,r));(null==c?void 0:c.service)?t[e]=c.service:(null==c?void 0:c.promise)?i.push(c.promise.then(r=>{t[e]=r.service})):(null==c?void 0:c.builder)?(c.promise=c.builder(r),i.push(c.promise.then(r=>{t[e]=c.service=r.service,c.promise=void 0},e=>{throw console.error(`failed to build service ${c.type}/${c.version}: ${e}`),c.promise=void 0,e}))):"optional"in r&&r.optional||s.push(e)}),i.length>0?Promise.all(i).then(()=>[t,s]):r([t,s])}},e.buildStaticServiceResolver=u,e.default=function(e,n=3e4){let o;return function(e){for(const n of e){let e;if(t(n)?n.then(r=>{e=n},r=>{e=n}):e=r(n),void 0!==e)return e}return Promise.race(e)}([s.then(r=>r(e).then(([e,r])=>
38{if(0===r.length)return e;throw new Error("no matches found for one or more requested services")})),new Promise((e,r)=>{o=setTimeout(()=>r(new Error("OneStore services unavailable")),n)})]).then(e=>(clearTimeout(o),e),e=>{throw clearTimeout(o),console.error(e),e})},e.resolve=function(e,r){const n={};for(const[t,i]of Object.entries(r)){const r=e.find(e=>o(e,i));if(r)n[t]=r.service;else if(!("optional"in i)||!i.optional)return}return n},e.serviceSatisfies=o,e.setServiceResolver=c,e.setServices=function(e){c(u(e))},Object.defineProperty(e,"__esModule",{value:!0})});
39})();(function() { LWR.define("force/clwrSfapExchange",["exports","@app/basePath"],function(e,t){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=n(t);e.getSfapJwt=function(){return fetch(`${f.default}/webruntime/sfap-info`).then(e=>e.json())},Object.defineProperty(e,"__esModule",{value:!0})});
40})();(function() { LWR.define("force/ldsWebruntimeOneStoreInit",["exports","@salesforce/loader","o11y/client","force/luvioTypeNormalization1","force/luvioOnestoreGraphqlParser","force/luvioServiceProvisioner1","force/ldsEngineWebruntime","force/clwrSfapExchange","@salesforce/i18n/lang","@app/isDesignMode","@app/isPreviewMode","@app/authenticationCookieName","@app/apiBasePath"],function(e,t,r,s,n,i,o,a,c,u,h,l,d){function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=f(i),v=f(c),m=f(u),y=f(h),g=f(l),b=f(d);
41/*!
42   * Copyright (c) 2022, Salesforce, Inc.,
43   * All rights reserved.
44   * For full license text, see the LICENSE.txt file
45   */
46const{create:w,freeze:k,keys:C,entries:R}=Object,{isArray:E}=Array,{stringify:T,parse:x}=JSON,O=WeakSet,S={TRACE:4,DEBUG:3,INFO:2,WARN:1,ERROR:0};let I=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}},A=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}};const P=e=>new I(e),N=e=>new A(e);function F(e){return null!=(t=e)&&"object"==typeof t&&"isOk"in t&&"isErr"in t&&"function"==typeof t.isOk&&"function"==typeof t.isErr&&(!0===t.isOk()&&!1===t.isErr()&&"value"in t||!1===t.isOk()&&!0===t.isErr()&&"error"in t)&&("object"==typeof(r=e.isOk()?e.value:e.error)&&null!==r&&"subscribe"in r&&"function"==typeof r.subscribe&&"refresh"in r&&"function"==typeof r.refresh);var t,r}function q(e,t,r){return e.isOk()?P({data:e.value,subscribe:t,refresh:r}):N({failure:e.error,subscribe:t,refresh:r})}function $(e){return D(e)?e.then(e=>e):{then:(t,r)=>
46{try{return $(t(e))}catch(r){return void 0===t?$(e):U(r)}}}}function U(e){return D(e)?e.then(e=>e):{then:(t,r)=>{if("function"==typeof r)try{return $(r(e))}catch(e){return U(e)}return U(e)}}}function D(e){return"function"==typeof(null==e?void 0:e.then)}function j(e,t){if(void 0===e)return void 0===t;if(null===e)return null===t;if(null===t)return null===e;if(E(e)){if(!E(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!j(e[r],t[r]))return!1;return!0}if("object"==typeof e){if("object"!=typeof t)return!1;const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(let s=0;s<r.length;++s){const n=r[s];if(!j(e[n],t[n]))return!1}return!0}return e===t}function L(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===e)return;if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return T(e);let t,r;if(E(e)){for(r="[",t=0;t<e.length;t++)t&&(r+=","),r+=L(e[t])||"null";return r+"]"}if(null===e)return"null";const s=C(e).sort();for(r="",t=0;t<s.length;t++){const n=s[t],i=L(e[n]);i&&(r&&(r+=","),r+=T(n)+":"+i)}return"{"+r+"}"}function M(e){return e instanceof Error?e:new Error("string"==typeof e?e:JSON.stringify(e))}var H=(e=>(e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.NoContent=204]="NoContent",e[e.NotModified=304]="NotModified",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.ServerError=500]="ServerError",e[e.GatewayTimeout=504]="GatewayTimeout",e))(H||{});class B extends Error{constructor(e,t,r){super(),this.status=e,this.body=t,this.headers=r||{},this.ok=e>=200&&this.status<=299,this.statusText=function(e){switch(e){case 200:return"OK";case 201:return"Created";case 304:return"Not Modified";case 400:return"Bad Request";case 404:return"Not Found";case 500:return"Server Error";default:return`Unexpected HTTP Status Code: ${e}`}}(e)}}const _=new O;function Q(e){if("object"==typeof e&&null!==e&&!_.has(e)){if(_.add(e),E(e))for(let t=0,r=e.length;t<r;t+=1)Q(e[t]);else{const t=C(e);for(let r=0,s=t.length;r<s;r+=1)Q(e[t[r]])}k(e)}}class V extends Error{constructor(e){super(),this.data=e,this.type="internal"}}class G extends Error{constructor(e){super(),this.data=e,this.type="user-visible"}}function W(e){return e instanceof Error&&"type"in e&&"user-visible"===e.type}function J(e){W(e)||console.error("OneStore Command threw an error that we did not expect",e)}
47/*!
48   * Copyright (c) 2022, Salesforce, Inc.,
49   * All rights reserved.
50   * For full license text, see the LICENSE.txt file
51   */class z{}
52/*!
53   * Copyright (c) 2022, Salesforce, Inc.,
54   * All rights reserved.
55   * For full license text, see the LICENSE.txt file
56   */let K=class extends z{constructor(e){super(),this.services=e,this.subscriptions=[],this.exposeSubscribeAndRefresh=!1}execute(){const e=this.fetch();return this.exposeSubscribeAndRefresh?this.fetchSubscribableResult(e):e}fetchSubscribableResult(e){return e.then(e=>q(e,e=>(this.subscriptions.push(e),()=>{this.subscriptions=this.subscriptions.filter(t=>t!==e)}),()=>this.refresh()))}refresh(){return this.execute().then(e=>{if(F(e)){const t=e.isOk()?P(e.value.data):N(e.error.failure);this.subscriptions.forEach(e=>{e(t)})}return P(void 0)})}async afterRequestHooks(e){}};
57/*!
58   * Copyright (c) 2022, Salesforce, Inc.,
59   * All rights reserved.
60   * For full license text, see the LICENSE.txt file
61   */
62class X extends K{constructor(e){super(e),this.services=e,this.actionConfig={background:!1,hotspot:!0,longRunning:!1,storable:!1},this.networkPreference="aura",this.additionalNullResponses=[]}get fetchParams(){throw new Error("Fetch parameters must be specified when using HTTP transport on an Aura adapter")}coerceAuraErrors(e){return M(e[0])}async coerceError(e){return M(e.statusText)}convertAuraResponseToData(e,t){return e.then(e=>{const t=e.getReturnValue();try{this.afterRequestHooks({statusCode:200})}catch{}return P(t)}).catch(e=>{if(e&&e.getError){const r=e.getError();return r.length>0?N(t(r)):N(M("Error fetching component"))}return N(M("Failed to get error from response"))})}isSemanticNullResponse(e){return this.additionalNullResponses.includes(e.status)}isProtocolNoBodyStatus(e){return 204===e||205===e}isUndeclaredNoBodyResponse(e){return this.isProtocolNoBodyStatus(e.status)&&!this.isSemanticNullResponse(e)}convertFetchResponseToData(e){return e.then(e=>{if(e.ok){let t;return t=this.isSemanticNullResponse(e)?Promise.resolve(P(null)):this.isUndeclaredNoBodyResponse(e)?Promise.resolve(N(M(`Unexpected ${e.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`))):e.json().then(e=>P(e),e=>N(M(e))),t.finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}})}return this.coerceError(e).then(e=>N(e)).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}})},e=>N(M(e)))}shouldUseAuraNetwork(){return void 0!==this.services.auraNetwork&&("aura"===this.networkPreference||!this.services.fetch)}shouldUseFetch(){return void 0!==this.services.fetch&&("http"===this.networkPreference||!this.services.auraNetwork)}fetch(){if(this.shouldUseAuraNetwork())return this.convertAuraResponseToData(this.services.auraNetwork(this.endpoint,this.auraParams,this.actionConfig),this.coerceAuraErrors);if(this.shouldUseFetch()){const e=this.fetchParams;try{return this.convertFetchResponseToData(this.services.fetch(...e))}catch(e){return $(N(M(e)))}}return $(N(M("Aura/Fetch network services not found")))}}
63/*!
64   * Copyright (c) 2022, Salesforce, Inc.,
65   * All rights reserved.
66   * For full license text, see the LICENSE.txt file
67   */
68/*!
69   * Copyright (c) 2022, Salesforce, Inc.,
70   * All rights reserved.
71   * For full license text, see the LICENSE.txt file
72   */
73const{isArray:Y}=Array;let Z=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}};class ee{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}}const te=e=>new Z(e),re=e=>new ee(e);function se(e,t,r){return e.isOk()?te({data:e.value,subscribe:t,refresh:r}):re({failure:e.error,subscribe:t,refresh:r})}function ne(e){return oe(e)?e.then(e=>e):{then:(t,r)=>{try{return ne(t(e))}catch(r){return void 0===t?ne(e):ie(r)}}}}function ie(e){return oe(e)?e.then(e=>e):{then:(t,r)=>{if("function"==typeof r)try{return ne(r(e))}catch(e){return ie(e)}return ie(e)}}}function oe(e){return"function"==typeof(null==e?void 0:e.then)}function ae(e,t){if(void 0===e)return void 0===t;if(null===e)return null===t;if(null===t)return null===e;if(Y(e)){if(!Y(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!ae(e[r],t[r]))return!1;return!0}if("object"==typeof e){if("object"!=typeof t)return!1;const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(let s=0;s<r.length;++s){const n=r[s];if(!ae(e[n],t[n]))return!1}return!0}return e===t}function ce(e,t){if(e.size>t.size){for(const r of t.keys())if(e.has(r))return!0}else for(const r of e)if(t.has(r))return!0;return!1}class ue{constructor(e,t,r){this.readFromCacheInternal=e,this.requestFromNetworkInternal=t,this.writeToCacheInternal=r}readFromCache(e){return this.readFromCacheInternal(e).then(e=>e.isErr()?re(e.error.failure):(this.returnData=e,te(void 0)))}requestFromNetwork(){const e=this;return async function*(){const t=await e.requestFromNetworkInternal();t.isErr()?e.networkError=t:e.networkData=t,yield t}()}writeToCache(e,t){return this.writeToCacheInternal(e,t)}}class he extends z{constructor(e){super(),this.services=e,this.keysUsed=new Set,this.keysUpdated=void 0,this._isInternalExecution=!1,this.lastResult=void 0,this.unsubscribers=[],this.subscriptions=[],this.instantiationTime=Date.now()/1e3}get isInternalExecution(){return this._isInternalExecution}execute(e){this.keysUpdated=void 0,this.unsubscribe();const t=function(e,t){if(!t)return e;const r=t.now??e.now;if(!t.cacheControlConfig)return{...e,now:r};return{...t.cacheControlConfig,now:r}}
74/*!
75   * Copyright (c) 2022, Salesforce, Inc.,
76   * All rights reserved.
77   * For full license text, see the LICENSE.txt file
78   */
79/*!
80   * Copyright (c) 2022, Salesforce, Inc.,
81   * All rights reserved.
82   * For full license text, see the LICENSE.txt file
83   */(this.cacheControlStrategyConfig,e),r=this.buildRequestRunner();return this.services.cacheController.execute(t,r,{instrumentationAttributes:this.instrumentationAttributes}).then(e=>this.handleCacheControllerResult(e,r).then(e=>(void 0===this.lastResult&&(e.isErr()?this.lastResult={type:"error",error:e.error.failure}:this.lastResult={type:"data",data:e.value.data}),e)))}handleCacheControllerResult(e,t){const{networkError:r,networkData:s,returnData:n}=t;return this.publishUpdatedKeys().then(()=>r?se(r,this.buildSubscribe(),()=>this.refresh()):e.isErr()?se(s||e,this.buildSubscribe(),()=>this.refresh()):void 0===n?se(s||re(new Error("Cache miss after fetching from network")),this.buildSubscribe(),()=>this.refresh()):(this.subscriptions.length>0&&this.subscribe(),n))}buildRequestRunner(){return new ue(e=>this.buildResultWithSubscribe(e),()=>this.requestFromNetwork(),(e,t)=>this.writeToCacheAndRecordKeys(e,t))}publishUpdatedKeys(){return this.services.pubSub&&void 0!==this.keysUpdated&&this.keysUpdated.size>0?this.services.pubSub.publish({type:"cacheUpdate",data:this.keysUpdated}):ne(void 0)}get operationType(){return"query"}subscribe(){this.unsubscribe();const{pubSub:e}=this.services;if(!e)return;const t=e.subscribe({type:"cacheUpdate",predicate:e=>ce(e.data,this.keysUsed),callback:()=>this.rerun({now:this.instantiationTime}).then(()=>{}),keys:this.keysUsed}),r=e.subscribe({type:"cacheInvalidation",predicate:e=>ce(e.data,this.keysUsed),callback:()=>this.rerun().then(()=>{}),keys:this.keysUsed}),s=e.subscribe({type:"cacheEviction",predicate:e=>ce(e.data,this.keysUsed),callback:()=>this.rerun().then(()=>{}),keys:this.keysUsed});this.unsubscribers.push(t,r,s)}unsubscribe(){for(;this.unsubscribers.length>0;){const e=this.unsubscribers.pop();null==e||e()}}equals(e,t){return ae(e,t)}async afterRequestHooks(e){}refresh(){return this.rerun({cacheControlConfig:{type:"no-cache"}}).then(e=>e.isErr()?re(e.error.failure):te(void 0))}writeToCacheAndRecordKeys(e,t){const r=e.record();return this.writeToCache(r,t).then(e=>(this.instantiationTime=Date.now()/1e3,this.keysUpdated=r.keysUpdated,te(e)))}buildResultWithSubscribe(e){const t=e.record();return this.readFromCache(t).then(e=>{if(e.isErr())return se(e,this.buildSubscribe(),()=>this.refresh());
83{const r=e.value;return this.keysUsed=t.keysRead,se(te(r),this.buildSubscribe(),()=>this.refresh())}})}buildSubscribe(){return e=>(0===this.subscriptions.length&&"query"===this.operationType&&this.subscribe(),this.subscriptions.push(e),()=>{this.subscriptions=this.subscriptions.filter(t=>t!==e),0===this.subscriptions.length&&this.unsubscribe()})}rerun(e){return this._isInternalExecution=!0,this.execute(e).then(e=>(this._isInternalExecution=!1,e.isErr()?(this.lastResult={type:"error",error:e.error.failure},this.invokeConsumerCallbacks(re(e.error.failure)),e):(void 0!==this.lastResult&&"error"!==this.lastResult.type&&this.equals(this.lastResult.data,e.value.data)||(this.lastResult={type:"data",data:e.value.data},this.invokeConsumerCallbacks(te(e.value.data))),e)))}invokeConsumerCallbacks(e){this.subscriptions.forEach(t=>{try{t(e)}catch{}})}}let le=class extends he{constructor(e){super(e),this.services=e,this.actionConfig={background:!1,hotspot:!0,longRunning:!1,storable:!1},this.networkPreference="aura"}get fetchParams(){throw new Error("Fetch parameters must be specified when using HTTP transport on an Aura adapter")}shouldUseAuraNetwork(){return void 0!==this.services.auraNetwork&&("aura"===this.networkPreference||!this.services.fetch)}shouldUseFetch(){return void 0!==this.services.fetch&&("http"===this.networkPreference||!this.services.auraNetwork)}requestFromNetwork(){if(this.shouldUseAuraNetwork())return this.convertAuraResponseToData(this.services.auraNetwork(this.endpoint,this.auraParams,this.actionConfig),e=>this.coerceAuraErrors(e));if(this.shouldUseFetch()){const e=this.fetchParams;try{return this.convertFetchResponseToData(this.services.fetch(...e))}catch(e){return $(N(M(e)))}}return $(N(M("Aura/Fetch network services not found")))}coerceAuraErrors(e){return M(e[0])}async coerceError(e){return M(e.statusText)}processAuraReturnValue(e){return P(e)}processFetchReturnValue(e){return P(e)}convertAuraResponseToData(e,t){return e.then(e=>this.processAuraReturnValue(e.getReturnValue())).finally(()=>{try{this.afterRequestHooks({statusCode:200})}catch{}}).catch(e=>{if(e&&e.getError){const r=e.getError();return r.length>0?N(t(r)):N(M("Error fetching component"))}return N(M("Failed to get error from response"))})}convertFetchResponseToData(e){return e.then(e=>e.ok?e.json().then(e=>this.processFetchReturnValue(e),e=>N(M(e))).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}}):this.coerceError(e).then(e=>N(e)).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}}),e=>N(M(e)))}};class de extends le{constructor(e){super(e),this.services=e}readFromCache(e){var t;const r=null==(t=e.get(this.buildKey()))?void 0:t.value;return $(void 0===r?N(new Error("Failed to find data in cache")):P(r))}writeToCache(e,t){return t.isOk()&&e.set(this.buildKey(),{value:t.value,metadata:{cacheControl:this.buildCacheControlMetadata(t.value)}}),$(void 0)}buildKey(){return`{"endpoint":${this.endpoint},"params":${L(this.auraParams)}}`}}
84/*!
85   * Copyright (c) 2022, Salesforce, Inc.,
86   * All rights reserved.
87   * For full license text, see the LICENSE.txt file
88   */
89/*!
90   * Copyright (c) 2022, Salesforce, Inc.,
91   * All rights reserved.
92   * For full license text, see the LICENSE.txt file
93   */
94class fe extends he{constructor(e){super(e),this.services=e,this.actionConfig={background:!1,hotspot:!0,longRunning:!1,storable:!1},this.networkPreference="aura"}get fetchParams(){throw new Error("Fetch parameters must be specified when using HTTP transport on an Aura adapter")}shouldUseAuraNetwork(){return void 0!==this.services.auraNetwork&&("aura"===this.networkPreference||!this.services.fetch)}shouldUseFetch(){return void 0!==this.services.fetch&&("http"===this.networkPreference||!this.services.auraNetwork)}requestFromNetwork(){if(this.shouldUseAuraNetwork())return this.convertAuraResponseToData(this.services.auraNetwork(this.endpoint,this.auraParams,this.actionConfig),e=>this.coerceAuraErrors(e));if(this.shouldUseFetch()){const e=this.fetchParams;try{return this.convertFetchResponseToData(this.services.fetch(...e))}catch(e){return $(N(M(e)))}}return $(N(M("Aura/Fetch network services not found")))}coerceAuraErrors(e){return M(e[0])}async coerceError(e){return M(e.statusText)}processAuraReturnValue(e){return P(e)}processFetchReturnValue(e){return P(e)}convertAuraResponseToData(e,t){return e.then(e=>this.processAuraReturnValue(e.getReturnValue())).finally(()=>{try{this.afterRequestHooks({statusCode:200})}catch{}}).catch(e=>{if(e&&e.getError){const r=e.getError();return r.length>0?N(t(r)):N(M("Error fetching component"))}return N(M("Failed to get error from response"))})}convertFetchResponseToData(e){return e.then(e=>e.ok?e.json().then(e=>this.processFetchReturnValue(e),e=>N(M(e))).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}}):this.coerceError(e).then(e=>N(e)).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}}),e=>N(M(e)))}}class pe extends fe{constructor(e){super(e),this.services=e}readFromCache(e){const t=this.buildResultType().query(e,this.buildQuery());return t.isErr()?$(N(new Error(`Failed to build data from type: ${T(t.error)}`))):$(P(t.value))}writeToCache(e,t){return t.isOk()&&this.buildResultType().write(e.buildFixedTimeWritableCache(Date.now()/1e3),this.buildWriteInput(t.value)),$(void 0)}}
95/*!
96   * Copyright (c) 2022, Salesforce, Inc.,
97   * All rights reserved.
98   * For full license text, see the LICENSE.txt file
99   */
100/*!
101   * Copyright (c) 2022, Salesforce, Inc.,
102   * All rights reserved.
103   * For full license text, see the LICENSE.txt file
104   */
105class ve extends he{constructor(e){super(e),this.services=e,this.additionalNullResponses=[]}requestFromNetwork(){return this.fetch()}fetch(){try{return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams))}catch(e){return $(N(M(e)))}}isSemanticNullResponse(e){return this.additionalNullResponses.includes(e.status)}isProtocolNoBodyStatus(e){return 204===e||205===e}isUndeclaredNoBodyResponse(e){return this.isProtocolNoBodyStatus(e.status)&&!this.isSemanticNullResponse(e)}async coerceError(e){return M(e.statusText)}processFetchReturnValue(e){return P(e)}convertFetchResponseToData(e){return e.then(e=>{if(e.ok){let t;return t=this.isSemanticNullResponse(e)?Promise.resolve(P(null)):this.isUndeclaredNoBodyResponse(e)?Promise.resolve(N(M(`Unexpected ${e.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`))):e.json().then(e=>this.processFetchReturnValue(e),e=>N(M(e))),t.finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}})}return this.coerceError(e).then(e=>N(e)).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}})},e=>N(M(e)))}}class me extends ve{constructor(e){super(e),this.services=e}readFromCache(e){const t=this.buildResultType().query(e,this.buildQuery());return t.isErr()?$(N(new Error(`Failed to build data from type: ${T(t.error)}`))):$(P(t.value))}writeToCache(e,t){return t.isOk()&&this.buildResultType().write(e.buildFixedTimeWritableCache(Date.now()/1e3),this.buildWriteInput(t.value)),$(void 0)}}
106/*!
107   * Copyright (c) 2022, Salesforce, Inc.,
108   * All rights reserved.
109   * For full license text, see the LICENSE.txt file
110   */
111/*!
112   * Copyright (c) 2022, Salesforce, Inc.,
113   * All rights reserved.
114   * For full license text, see the LICENSE.txt file
115   */
116class ye extends z{constructor(e){super(),this.services=e,this.subscriptions=[],this.exposeSubscribeAndRefresh=!1}execute(){const e=this.fetch();
116return this.exposeSubscribeAndRefresh?this.fetchSubscribableResult(e):e}fetchSubscribableResult(e){return e.then(e=>q(e,e=>(this.subscriptions.push(e),()=>{this.subscriptions=this.subscriptions.filter(t=>t!==e)}),()=>this.refresh()))}refresh(){return this.execute().then(e=>{if(F(e)){const t=e.isOk()?P(e.value.data):N(e.error.failure);this.subscriptions.forEach(e=>{e(t)})}return P(void 0)})}async afterRequestHooks(e){}}const ge=class extends ye{constructor(e){super(e),this.services=e,this.additionalNullResponses=[]}fetch(e){try{const[t,r]=this.fetchParams,s=void 0===e?r:{...r,__contextSeed:e},n=void 0===s?this.services.fetch(t):this.services.fetch(t,s);return this.convertFetchResponseToData(n)}catch(e){return $(N(M(e)))}}isSemanticNullResponse(e){return this.additionalNullResponses.includes(e.status)}isProtocolNoBodyStatus(e){return 204===e||205===e}isUndeclaredNoBodyResponse(e){return this.isProtocolNoBodyStatus(e.status)&&!this.isSemanticNullResponse(e)}async coerceError(e){return M(e.statusText)}convertFetchResponseToData(e){return e.then(e=>{if(e.ok){let t;return t=this.isSemanticNullResponse(e)?Promise.resolve(P(null)):this.isUndeclaredNoBodyResponse(e)?Promise.resolve(N(M(`Unexpected ${e.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`))):e.json().then(e=>P(e),e=>N(M(e))),t.finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}})}return this.coerceError(e).then(e=>N(e)).finally(()=>{try{this.afterRequestHooks({statusCode:e.status})}catch{}})},e=>N(M(e)))}};ge.availableDecorators={abortable:function(e,t){if(!((null==t?void 0:t.signal)&&(null==t?void 0:t.signal)instanceof AbortSignal))return e;const{signal:r}=t;if(function(e){return"isAbortableCommand"in e&&!0===e.isAbortableCommand}(e))return e;if(!function(e){return e&&"object"==typeof e&&"fetchParams"in e}(e))return e;try{return new Proxy(e,{get(e,t,s){if("isAbortableCommand"===t)return!0;if("signal"===t)return r;if("fetchParams"===t){const s=e[t],n=!0===e.isInternalExecution;if("function"==typeof s)return function(...e){const t=s.apply(this,e);if(!n){const[e,s={}]=t;return[e,{signal:r,...s}]}return t};if(!n&&s&&Array.isArray(s)){const[e,t={}]=s;return[e,{signal:r,...t}]}return s}return Reflect.get(e,t,s)},has:(e,t)=>"isAbortableCommand"===t||"signal"===t||Reflect.has(e,t)})}catch(t){return e}}};let be=ge;
117/*!
118   * Copyright (c) 2022, Salesforce, Inc.,
119   * All rights reserved.
120   * For full license text, see the LICENSE.txt file
121   */
122class we extends z{constructor(e){super(),this.services=e}execute(){try{return this.convertFetchStreamResponseToData(this.services.fetch(...this.fetchParams))}catch(e){return $(N(M(e)))}}convertFetchStreamResponseToData(e){return e.then(e=>e.ok&&e.body?P(this.decodeByteStream(e.body)):N(M(e.ok?"Response body not present":e.statusText)),e=>N(M(e)))}}
123/*!
124   * Copyright (c) 2022, Salesforce, Inc.,
125   * All rights reserved.
126   * For full license text, see the LICENSE.txt file
127   */
128class ke extends we{constructor(e){super(e),this.services=e}decodeByteStream(e){return this.decodeSSEStream(e.pipeThrough(new TextDecoderStream).pipeThrough(new Re))}}const Ce=/^(?<field>[^:]*?)(: ?(?<value>.*?))?(?:\r\n?|\n)/;class Re extends TransformStream{constructor(){let e,t=!1,r="",s="",n="",i="";super({transform(o,a){t&&o.startsWith("\n")&&(o=o.slice(1)),t=o.endsWith("\r");let c,u=r+o;for(;c=u.match(Ce);)if(u=u.slice(c[0].length),""===c.groups.field&&void 0===c.groups.value){if(""===s){n="";continue}s.endsWith("\n")&&(s=s.slice(0,-1));const t={data:s,id:i,event:n||"message"};void 0!==e&&(t.retry=e),a.enqueue(t),s=n=""}else if("data"===c.groups.field)s+=(c.groups.value||"")+"\n";else if("event"===c.groups.field)n=c.groups.value||"";else if("id"===c.groups.field){const e=c.groups.value||"";e.includes("\0")||(i=e)}else"retry"===c.groups.field&&/^\d+$/.exec(c.groups.value)&&(e=parseInt(c.groups.value));r=u}})}}
129/*!
130   * Copyright (c) 2022, Salesforce, Inc.,
131   * All rights reserved.
132   * For full license text, see the LICENSE.txt file
133   */
134function Ee(e){const t=e.instrumentation.metrics.getMeter("onestore");return function(r,s){const n=t.createCounter(`${s}.command.invocation.count`),i=t.createCounter(`${s}.command.error.count`),o=t.createCounter(`${s}.command.abort.count`),a=t.createHistogram(`${s}.command.duration`);return class extends r{execute(...t){let r;n.add(1);const s=e.instrumentation.currentTimeMs();function c(){const t=e.instrumentation.currentTimeMs();a.record(t-s)}try{r=super.execute(...t)}catch(e){throw"AbortError"===(null==e?void 0:e.name)?o.add(1):i.add(1),e}return"object"==typeof r&&null!==r&&"then"in r?r.then(c,()=>{i.add(1)}):c(),r}}}}
135/*!
136   * Copyright (c) 2022, Salesforce, Inc.,
137   * All rights reserved.
138   * For full license text, see the LICENSE.txt file
139   */
140/*!
141   * Copyright (c) 2022, Salesforce, Inc.,
142   * All rights reserved.
143   * For full license text, see the LICENSE.txt file
144   */
145class Te{constructor(e){this.services=e}getTracer(e,t,s){const n=r.getInstrumentation(e);return new xe(n,this.services.logger)}}class xe{constructor(e,t){this.o11yInstrumentation=e,this.logger=t}startSpan(e,t,r){const s=null==r?void 0:r.getValue(Symbol.for("traceId")),n=null==r?void 0:r.getValue(Symbol.for("spanId")),i=null==r?void 0:r.getValue(Symbol.for("traceFlags"));let o;void 0!==s&&void 0!==n&&void 0!==i&&(o={traceId:s,spanId:n,traceFlags:i});const a=void 0===o?void 0:{instrumentationContext:{rootId:o.traceId,isRootActivitySampled:1===o.traceFlags,parentId:n}},c=this.o11yInstrumentation.startActivity(e,a);return new Oe(c,this.logger)}startActiveSpan(e,t,r,s){let n,i,o;"function"==typeof t?o=t:(n=t,"function"==typeof r?o=r:(i=r,o=s));return o(this.startSpan(e,n,i))}}class Oe{constructor(e,t){this.activity=e,this.logger=t,this._isRecording=!0,this.attributes={}}spanContext(){return{traceId:this.activity.getRootId(),spanId:this.activity.getId(),traceFlags:this.activity.getIsSampled()?1:0}}setAttribute(e,t){return this.attributes[e]=t,this}setAttributes(e){return this.attributes={...this.attributes,...e},this}addEvent(e,t,r){return this.logger.warn("O11ySpan does not support addEvents."),this}setStatus(e){return this.logger.warn("O11ySpan does not support setStatus."),this}updateName(e){return this.logger.warn("O11ySpan does not support updateName."),this}end(e){let t=e;try{"number"!=typeof t&&(this.logger.warn("O11ySpan does not support non number endTime override."),t=void 0),this.activity.stop(void 0,void 0,t?{perfStopOverride:t}:void 0)}finally{this._isRecording=!1}}isRecording(){return this._isRecording}
145recordException(e,t){this.activity.error(e)}}class Se{constructor(e){this.services=e}getMeter(e,t,s){const n=r.getInstrumentation(e);return new Ie(n,this.services.logger)}}class Ie{constructor(e,t){this.o11yInstrumentation=e,this.logger=t}createHistogram(e,t){return new Pe(e,this.o11yInstrumentation,this.logger)}createCounter(e,t){return t&&this.logger.warn("counter options not supported in O11y instrumentation"),new Ae(e,this.o11yInstrumentation,this.logger)}createUpDownCounter(e,t){return new Ne(this.logger)}createObservableGauge(e,t){return new qe(this.logger)}createObservableCounter(e,t){return new Fe(this.logger)}createObservableUpDownCounter(e,t){return new $e(this.logger)}addBatchObservableCallback(e,t){this.logger.warn("addBatchObservableCallback not supported yet")}removeBatchObservableCallback(e,t){this.logger.warn("removeBatchObservableCallback not supported yet")}}class Ae{constructor(e,t,r){this.name=e,this.o11yInstrumentation=t,this.logger=r}add(e,t,r){e<0?this.logger.warn(`Counter values must be non-negative. Got ${e}.`):this.o11yInstrumentation.incrementCounter(this.name,e,void 0,Ue(t))}}class Pe{constructor(e,t,r){this.name=e,this.o11yInstrumentation=t,this.logger=r}record(e,t,r){e<0?this.logger.warn(`Histogram values must be non-negative. Got ${e}.`):this.o11yInstrumentation.trackValue(this.name,e,void 0,Ue(t))}}class Ne{constructor(e){this.logger=e}add(e,t,r){this.logger.warn("O11yUpDownCounter not supported yet.")}}class Fe{constructor(e){this.logger=e}addCallback(e){this.logger.warn("O11yObservableCounter not supported yet. Defaulting to noop.")}removeCallback(e){this.logger.warn("O11yObservableCounter not supported yet. Defaulting to noop.")}}class qe{constructor(e){this.logger=e}addCallback(e){this.logger.warn("O11yObservableGuage not supported yet. Defaulting to noop.")}removeCallback(e){this.logger.warn("O11yObservableGuage not supported yet. Defaulting to noop.")}}class $e{constructor(e){this.logger=e}addCallback(e){this.logger.warn("O11yObservableUpDownCounter not supported yet. Defaulting to noop.")}removeCallback(e){this.logger.warn("O11yObservableUpDownCounter not supported yet. Defaulting to noop.")}}function Ue(e){if(!e)return;const t={};return Object.entries(e).forEach(([e,r])=>{void 0===r||Array.isArray(r)||(t[e]=r)}),t}class De{constructor(e){this.services=e,this.currentTimeMs=()=>performance.now(),this.trace=new Te(this.services),this.metrics=new Se(this.services)}}
146/*!
147   * Copyright (c) 2022, Salesforce, Inc.,
148   * All rights reserved.
149   * For full license text, see the LICENSE.txt file
150   */
151/*!
152   * Copyright (c) 2022, Salesforce, Inc.,
153   * All rights reserved.
154   * For full license text, see the LICENSE.txt file
155   */
156const{stringify:je,parse:Le}=JSON;function Me(e){const t=je(e);return t?Le(t):void 0}class He{constructor(e){this.baseCache=e,this.keysRead=new Set,this.missingKeysRead=new Set,this.keysUpdated=new Set,this.metadataKeysUpdated=new Set}delete(e){this.keysUpdated.add(e),this.baseCache.delete(e)}get(e,t){this.keysRead.add(e);const r=this.baseCache.get(e);return void 0===r&&this.missingKeysRead.add(e),(null==t?void 0:t.copy)?Me(r):r}set(e,t){this.keysUpdated.add(e),this.metadataKeysUpdated.add(e),this.baseCache.set(e,t)}setMetadata(e,t){this.metadataKeysUpdated.add(e),this.baseCache.setMetadata(e,t)}length(){return this.baseCache.length()}keys(){return this.baseCache.keys()}entries(){return this.baseCache.entries()}record(){return new He(this)}filter(e){return new Be(this,e)}buildFixedTimeWritableCache(e){return new _e(this,e)}}class Be{constructor(e,t){this.baseCache=e,this.predicate=t}delete(e){this.baseCache.delete(e)}get(e,t){const r=this.baseCache.get(e);if(r&&this.predicate(e,r))return(null==t?void 0:t.copy)?Me(r):r}set(e,t){this.baseCache.set(e,t)}setMetadata(e,t){this.baseCache.setMetadata(e,t)}length(){return this.getFilteredKeys().size}keys(){return this.getFilteredKeys()}entries(){return this.getFilteredEntries()}record(){return new He(this)}filter(e){return new Be(this,e)}getFilteredEntries(){return this.baseCache.entries().filter(([e,t])=>this.get(e))}getFilteredKeys(){const e=new Set;
156return this.baseCache.keys().forEach(t=>{this.get(t)&&e.add(t)}),e}buildFixedTimeWritableCache(e){return new _e(this,e)}}class _e{constructor(e,t){this.baseCache=e,this.generatedTime=t}delete(e){this.baseCache.delete(e)}get(e,t){return this.baseCache.get(e,t)}set(e,t){this.baseCache.set(e,{...t,metadata:{...t.metadata,cacheControl:{...t.metadata.cacheControl,generatedTime:this.generatedTime}}})}setMetadata(e,t){this.baseCache.setMetadata(e,{...t,generatedTime:this.generatedTime})}length(){return this.baseCache.length()}keys(){return this.baseCache.keys()}entries(){return this.baseCache.entries()}record(){return new He(this)}filter(e){return new Be(this,e)}buildFixedTimeWritableCache(e){return new _e(this,e)}}class Qe{constructor(){this.data={}}get(e,t){return(null==t?void 0:t.copy)?Me(this.data[e]):this.data[e]}set(e,t){"no-store"!==t.metadata.cacheControl.type&&(this.data[e]={...t,metadata:{...t.metadata,type:t.metadata.type||{namespace:"OneStore:Internal",name:"UnknownType"},cacheControl:{generatedTime:Date.now()/1e3,...t.metadata.cacheControl}}})}delete(e){delete this.data[e]}setMetadata(e,t){e in this.data&&(this.data[e].metadata.cacheControl={generatedTime:Date.now()/1e3,...t})}length(){return this.keys().size}keys(){return new Set(Object.keys(this.data))}entries(){return Object.entries(this.data)}record(){return new He(this)}filter(e){return new Be(this,e)}buildFixedTimeWritableCache(e){return new _e(this,e)}}
157/*!
158   * Copyright (c) 2022, Salesforce, Inc.,
159   * All rights reserved.
160   * For full license text, see the LICENSE.txt file
161   */
162class Ve{constructor(e,t,r){this.services=e,this.config=t,this.requestRunner=r,this.filteredCache=this.services.cache.filter((e,t)=>{const{cacheControl:r}=t.metadata;return!this.expiredChecks.some(e=>e(r))})}get expiredChecks(){return[e=>"max-age"===e.type&&this.config.now>e.generatedTime+e.maxAge,e=>"max-age"===e.type&&e.maxAge<=0,e=>"no-store"===e.type,e=>"no-cache"===e.type&&e.generatedTime<this.config.now]}}class Ge extends Ve{execute(){const e=this.filteredCache;return new Promise(async(t,r)=>{try{let r=P(void 0);for await(const s of this.requestRunner.requestFromNetwork()){if(s){const r=await this.services.cacheInclusionPolicy.write({l1:e,writeToL1:e=>this.requestRunner.writeToCache(e,s)});if(r.isErr())return t(r)}r=await this.services.cacheInclusionPolicy.read({l1:e,readFromL1:e=>this.requestRunner.readFromCache(e)}),r.isOk()&&t(r)}return t(r)}catch(e){return r(e)}})}}class We extends Ve{execute(e){const t=this.services.instrumentation?this.services.instrumentation.currentTimeMs():0;return this.services.cacheInclusionPolicy.read({l1:this.filteredCache,readFromL1:e=>this.requestRunner.readFromCache(e)}).then(r=>{if(r.isOk())return this.collectCacheHitInstrumentation(t,null==e?void 0:e.instrumentationAttributes),P(void 0);this.collectCacheMissInstrumentation(t,null==e?void 0:e.instrumentationAttributes);const s=this.filteredCache;return new Promise(async(e,t)=>{try{let t=P(void 0);for await(const r of this.requestRunner.requestFromNetwork()){if(r){const t=await this.services.cacheInclusionPolicy.write({l1:s,writeToL1:e=>this.requestRunner.writeToCache(e,r)});if(t.isErr())return e(N(t.error))}t=await this.services.cacheInclusionPolicy.read({l1:s,readFromL1:e=>this.requestRunner.readFromCache(e)}),t.isOk()&&e(P(void 0))}return e(t)}catch(e){return t(e)}})})}collectCacheHitInstrumentation(e,t){if(this.services.instrumentation){const r=this.services.instrumentation.metrics.getMeter("onestore");r.createCounter("command.max-age.cache-hit.count").add(1,t),r.createHistogram("command.max-age.cache-hit.duration").record(this.services.instrumentation.currentTimeMs()-e,t)}}collectCacheMissInstrumentation(e,t){if(this.services.instrumentation){const r=this.services.instrumentation.metrics.getMeter("onestore");r.createCounter("command.max-age.cache-miss.count").add(1,t),r.createHistogram("command.max-age.cache-miss.duration").record(this.services.instrumentation.currentTimeMs()-e,t)}}get expiredChecks(){const e=this.config;return[...super.expiredChecks,t=>t.generatedTime+e.requestMaxAge<e.now]}}class Je extends Ve{execute(e){const t=this.services.instrumentation?this.services.instrumentation.currentTimeMs():0;return this.services.cacheInclusionPolicy.read({l1:this.filteredCache,readFromL1:e=>this.requestRunner.readFromCache(e)}).then(r=>{if(r.isOk())return this.collectCacheHitInstrumentation(t,null==e?void 0:e.instrumentationAttributes),P(void 0);this.collectCacheMissInstrumentation(t,null==e?void 0:e.instrumentationAttributes);const s=new G(new B(H.GatewayTimeout,{error:"Cache miss for only-if-cached request"}));return N(s)})}get expiredChecks(){return[...super.expiredChecks,e=>"no-cache"===e.type]}collectCacheHitInstrumentation(e,t){if(this.services.instrumentation){const r=this.services.instrumentation.metrics.getMeter("onestore");r.createCounter("command.only-if-cached.cache-hit.count").add(1,t),r.createHistogram("command.only-if-cached.cache-hit.duration").record(this.services.instrumentation.currentTimeMs()-e,t)}}collectCacheMissInstrumentation(e,t){if(this.services.instrumentation){const r=this.services.instrumentation.metrics.getMeter("onestore");r.createCounter("command.only-if-cached.cache-miss.count").add(1,t),r.createHistogram("command.only-if-cached.cache-miss.duration").record(this.services.instrumentation.currentTimeMs()-e,t)}}}class ze{constructor(e){this.services=e}execute(e,t,r){return this.getCacheControlStrategy(e,t).execute(r)}getCacheControlStrategy(e,t){if("max-age"===e.type)return new We(this.services,e,t);if("no-cache"===e.type)return new Ge(this.services,e,t);if("only-if-cached"===e.type)return new Je(this.services,e,t);throw new Error(`Unknown cache control strategy ${e.type}`)}async*find(e){yield*this.services.cacheInclusionPolicy.find(e)}async*findAndModify(e,t){yield*this.services.cacheInclusionPolicy.findAndModify(e,t)}}function Ke(e,t,r){return{type:"cacheController",version:"1.0",service:new ze({cache:e,cacheInclusionPolicy:t,instrumentation:r})}}
163/*!
164   * Copyright (c) 2022, Salesforce, Inc.,
165   * All rights reserved.
166   * For full license text, see the LICENSE.txt file
167   */const Xe=Symbol("EventTypeWildcard");class Ye{constructor(){this.subscriptions=new Map}subscribe(e){let t=this.subscriptions.get(e.type);return void 0===t&&(t=[],this.subscriptions.set(e.type,t)),t.push(e),()=>{this.subscriptions.set(e.type,this.subscriptions.get(e.type).filter(t=>t!==e))}}publish(e){const t=[];
167return this.getSubscriptions(e).forEach(r=>{if(!this.getSubscriptions(e).includes(r))return;const s=r.callback.call(r,e);D(s)&&t.push(s)}),t.length>0?Promise.all(t).then(()=>{}):$(void 0)}getSubscriptions(e){const t=this.subscriptions.get(e.type),r=this.subscriptions.get(Xe);if(void 0===t&&void 0===r)return[];let s=[];return void 0!==t&&(s=t.filter(t=>!t.predicate||t.predicate(e))),s=[...s,...r||[]],s}}
168/*!
169   * Copyright (c) 2022, Salesforce, Inc.,
170   * All rights reserved.
171   * For full license text, see the LICENSE.txt file
172   */
173class Ze{}
174/*!
175   * Copyright (c) 2022, Salesforce, Inc.,
176   * All rights reserved.
177   * For full license text, see the LICENSE.txt file
178   */class et{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}}const tt=e=>new et(e);function rt(e){return nt(e)?e.then(e=>e):{then:(t,r)=>{try{return rt(t(e))}catch(r){return void 0===t?rt(e):st(r)}}}}function st(e){return nt(e)?e.then(e=>e):{then:(t,r)=>{if("function"==typeof r)try{return rt(r(e))}catch(e){return st(e)}return st(e)}}}function nt(e){return"function"==typeof(null==e?void 0:e.then)}function it(e){return(t,r)=>{if(!e)return!1;if((e=>"$and"in e)(e))return e.$and.every(e=>it(e)(t,r));if((e=>"$or"in e)(e))return e.$or.some(e=>it(e)(t,r));if((e=>"$not"in e)(e))return!it(e.$not)(t,r);if("key"in e)return function(e,t){if("$regex"in e)return e.$regex.test(t);return!1}(e.key,t);if("metadata"in e)return((e,t)=>{if("cacheControlType"in e&&t.type!==e.cacheControlType.$eq)return!1;if("maxAge"in e&&"max-age"===t.type){const r=t.maxAge??0;if(void 0!==e.maxAge.$gte&&r<e.maxAge.$gte||void 0!==e.maxAge.$lte&&r>e.maxAge.$lte)return!1}return!0})(e.metadata,r.metadata.cacheControl);if("value"in e)return!1;throw new Error("Unknown Query Operation")}}function ot(e,t){switch(e.type){case"invalidate":{const e=function(e){switch(e.type){case"max-age":case"stale-while-revalidate":if(0!==e.maxAge)return{...e,maxAge:0}}return}(t.metadata.cacheControl);return void 0!==e?{type:"metadata",metadata:e}:{type:"no-op"}}case"evict":return{type:"delete"};default:throw new Error(`Invalid update operation: ${e.type}`)}}class at extends Ze{constructor(e){super(),this.services=e}read(e){const{l1:t,readFromL1:r}=e;return r(t)}write(e){const{l1:t,writeToL1:r}=e;return r(t)}async*find(e){const t=this.services.cache,r=it(e),s=t.filter(r).entries();for(const e of s)yield e}async*findAndModify(e,t){const r=this.services.cache;for await(const[s,n]of this.find(e)){const e=ot(t,n);switch(e.type){case"entry":this.write({l1:r,writeToL1:t=>rt(tt(t.set(s,e.entry)))}),yield s;break;case"metadata":this.write({l1:r,writeToL1:t=>rt(tt(t.setMetadata(s,e.metadata)))}),yield s;break;case"delete":this.write({l1:r,writeToL1:e=>rt(tt(e.delete(s)))}),yield s}}}}
179/*!
180   * Copyright (c) 2022, Salesforce, Inc.,
181   * All rights reserved.
182   * For full license text, see the LICENSE.txt file
183   */
184class ct{constructor(){this.flags=new Map}set(e,t){this.flags.set(e,t)}get(e,t=!1){return this.flags.get(e)||t}}
185/*!
186   * Copyright (c) 2022, Salesforce, Inc.,
187   * All rights reserved.
188   * For full license text, see the LICENSE.txt file
189   */
190function ut(e){const t=e.query.definitions.filter(e=>e.kind===n.Kind.OPERATION_DEFINITION);if(0===t.length)return N(new Error("No operations found in query"));if(1===t.length&&!e.operationName)return P(t[0]);if(e.operationName){const r=t.find(t=>{var r;return(null==(r=t.name)?void 0:r.value)===e.operationName});return r?P(r):N(new Error(`Operation "${e.operationName}" not found in query`))}return N(new Error("Multiple operations found in query, and no operation name provided"))}function ht(e){const t=ut(e);if(t.isErr())return N(t.error);const r=t.value,s=r.selectionSet.selections,n=r.variableDefinitions,i=(null==n?void 0:n.reduce((t,r)=>{var s;return t[r.variable.name.value]={definition:r,value:null==(s=e.variables)?void 0:s[r.variable.name.value]},t},{}))||{},o=e.query.definitions.filter(ft).reduce((e,t)=>(e[t.name.value]=t,e),{});return P({selections:s,request:{definitions:{variables:i,fragments:o}},parentFieldSelection:void 0})}const lt={kind:n.Kind.FIELD,name:{kind:n.Kind.NAME,value:"__typename"}};function dt(e){return n.visit(e,{SelectionSet:{enter(e,t,r){if(function(e){return!!e&&!Array.isArray(e)&&e.kind===n.Kind.OPERATION_DEFINITION}(r))return;const{selections:s}=e;
190if(!s||0===s.length)return;const i=s.some(e=>function(e){return e.kind===n.Kind.FIELD}(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0)));return i?void 0:{...e,selections:[...s,lt]}}}})}function ft(e){return e.kind===n.Kind.FRAGMENT_DEFINITION}
191/*!
192   * Copyright (c) 2022, Salesforce, Inc.,
193   * All rights reserved.
194   * For full license text, see the LICENSE.txt file
195   */class pt extends pe{constructor(e,t,r){super(r),this.config=e,this.documentRootType=t,this.services=r}get operationType(){const e=ut(this.config);if(e.isErr())return"mutation";const t=e.value.operation.toString();return"mutation"===t||"query"===t?t:"mutation"}buildResultType(){return this.documentRootType}buildQuery(){const e=ht(this.config);if(e.isErr())throw e.error;return{type:"keyParams",keyParams:null,...e.value}}responseHasErrors(e){return e.errors&&e.errors.length>0}processAuraReturnValue(e){return this.responseHasErrors(e)?N(new G(e)):P(e)}processFetchReturnValue(e){return this.responseHasErrors(e)?N(new G(e)):P(e)}get auraBodyWrapperName(){}get auraParams(){const e={...this.config,query:n.print(this.buildRequestQuery())};return this.auraBodyWrapperName?{[this.auraBodyWrapperName]:e}:e}get fetchParams(){const e={...this.config,query:n.print(this.buildRequestQuery())},t={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return[this.url,t]}get originalAuraParams(){const e={...this.config,query:n.print(this.config.query)};return this.auraBodyWrapperName?{[this.auraBodyWrapperName]:e}:e}get originalFetchParams(){const e={...this.config,query:n.print(this.config.query)},t={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return[this.url,t]}runOriginalRequest(){if(this.shouldUseAuraNetwork())return this.convertAuraResponseToData(this.services.auraNetwork(this.endpoint,this.originalAuraParams,this.actionConfig),e=>this.coerceAuraErrors(e)).then(e=>q(e,this.buildSubscribe(),()=>this.refresh()));if(this.shouldUseFetch()){const e=this.originalFetchParams;try{return this.convertFetchResponseToData(this.services.fetch(...e)).then(e=>q(e,this.buildSubscribe(),()=>this.refresh()))}catch(e){return $(q(N(M(e)),this.buildSubscribe(),()=>this.refresh()))}}return $(q(N(M("Aura/Fetch network services not found")),this.buildSubscribe(),()=>this.refresh()))}buildRequestQuery(){const e=this.documentRootType.buildAugmentedQuery(this.config);if(e.isErr())throw e.error;return dt(e.value)}buildWriteInput(e){const t=ht({...this.config,query:this.buildRequestQuery()});if(t.isErr())throw new V(t.error);return{data:e.data,...t.value}}handleCacheControllerResult(e,t){if("mutation"===this.operationType)return super.handleCacheControllerResult(e,t);const{networkError:r,returnData:s}=t;return this.publishUpdatedKeys().then(()=>r||void 0===s||s.isErr()||e.isErr()?this.runOriginalRequest():(this.subscriptions.length>0&&this.subscribe(),s))}}
196/*!
197   * Copyright (c) 2022, Salesforce, Inc.,
198   * All rights reserved.
199   * For full license text, see the LICENSE.txt file
200   */
201class vt extends me{constructor(e,t,r){super(r),this.config=e,this.documentRootType=t,this.services=r}buildResultType(){return this.documentRootType}get operationType(){const e=ut(this.config);if(e.isErr())return"mutation";const t=e.value.operation.toString();return"mutation"===t||"query"===t?t:"mutation"}buildQuery(){const e=ht(this.config);if(e.isErr())throw e.error;return{type:"keyParams",keyParams:null,...e.value}}get fetchParams(){const e={...this.config,query:n.print(this.buildRequestQuery())},t={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return[this.url,t]}get originalFetchParams(){const e={...this.config,query:n.print(this.config.query)},t={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return[this.url,t]}buildRequestQuery(){const e=this.documentRootType.buildAugmentedQuery(this.config);if(e.isErr())throw e.error;return dt(e.value)}buildWriteInput(e){const t=ht({...this.config,query:this.buildRequestQuery()});if(t.isErr())throw new V(t.error);return{data:e.data,...t.value}}processFetchReturnValue(e){return e.errors&&e.errors.length>0?N(new G(e)):P(e)}
201runOriginalRequest(){return this.convertFetchResponseToData(this.services.fetch(...this.originalFetchParams)).then(e=>q(e,this.buildSubscribe(),()=>this.refresh()))}handleCacheControllerResult(e,t){if("mutation"===this.operationType)return super.handleCacheControllerResult(e,t);const{networkError:r,returnData:s}=t;return this.publishUpdatedKeys().then(()=>r||void 0===s||s.isErr()||e.isErr()?this.runOriginalRequest():(this.subscriptions.length>0&&this.subscribe(),s))}}
202/*!
203   * Copyright (c) 2022, Salesforce, Inc.,
204   * All rights reserved.
205   * For full license text, see the LICENSE.txt file
206   */
207class mt extends we{constructor(e){super(e),this.services=e}decodeByteStream(e){return this.decodeNDJSONStream(e.pipeThrough(new TextDecoderStream).pipeThrough(new yt))}}class yt extends TransformStream{constructor(){let e="";super({transform(t,r){const s=(e+t).split(/\r?\n/);e=s.pop()||"";for(const e of s){const t=e.trim();if(""!==t)try{const e=JSON.parse(t);r.enqueue(e)}catch{throw new Error(`Invalid NDJSON line: ${e}`)}}},flush(t){const r=e.trim();if(""!==r)try{const e=JSON.parse(r);t.enqueue(e)}catch{throw new Error(`Invalid NDJSON final line: ${e}`)}}})}}function gt(e){return{type:"luvio",version:"1.0",service:{luvio:e}}}
208/*!
209   * Copyright (c) 2022, Salesforce, Inc.,
210   * All rights reserved.
211   * For full license text, see the LICENSE.txt file
212   */
213class bt extends Error{constructor(e,t){super(e),this.validationErrors=[],this.validationErrors=t||[]}}class wt extends bt{}class kt extends bt{}class Ct extends bt{}class Rt extends bt{}class Et extends bt{}class Tt extends bt{}class xt{constructor(){this.errors=[]}add(e){this.errors.push(e)}append(e){e.isErr()&&this.errors.push(...e.error)}hasErrors(){return this.errors.length>0}prepend(e){this.errors.unshift(e)}toValidationResponse(){return this.hasErrors()?N(this.errors):P(!0)}}function Ot(e,t){const r=function(e,t,r="$",s=t){return Pt(e,t,r,s,new Map)}(e,t);if(r.isErr())throw(s=r.error)[0]instanceof wt?new wt(s[0].message,s):s[0]instanceof kt?new kt(s[0].message,s):s[0]instanceof Ct?new Ct(s[0].message,s):s[0]instanceof Rt?new Rt(s[0].message,s):s[0]instanceof Et?new Et(s[0].message,s):s[0]instanceof Tt?new Tt(s[0].message,s):new bt(s[0].message,s);var s}function St(e,t,r){return new Ct(`Expected type ${e} at path '${r}', found type ${t}.`)}function It(){return P(!0)}function At(e){return N([e])}function Pt(e,t,r,s,n){if(!0===t)return It();if(!1===t)return At(new bt(`Data at ${r} has schema 'false'`));const i=null===e?"null":Array.isArray(e)?"array":typeof e,o=new xt;return"anyOf"in t?o.append(function(e,t,r,s,n){let i=!1;const o=new xt;for(let a=0,{length:c}=t.anyOf;a<c;a++){const c=Pt(e,t.anyOf[a],`${r}.anyOf[${a}]`,s,n);if(c.isOk()){i=!0;break}o.append(c)}if(!i)return o.prepend(new bt(`Data at ${r} did not match any subschema in anyOf.`)),o.toValidationResponse();return It()}(e,t,r,s,n)):"oneOf"in t?o.append(function(e,t,r,s,n){if(void 0!==t.discriminator)return function(e,t,r,s,n){if(null===e||"object"!=typeof e||Array.isArray(e))return At(St("object",typeof e,r));const{propertyName:i,mapping:o}=t,a=e[i];if(void 0===a)return At(new Et(`Object at path '${r}' is missing required discriminator property '${i}'.`));if("string"!=typeof a)return At(St("string",typeof a,`${r}.${i}`));const c=o[a];if(void 0===c)return At(new bt(`Discriminator value '${a}' at '${r}.${i}' is not in the mapping. Expected one of: [${Object.keys(o).join(", ")}].`));return Pt(e,{$ref:c},r,s,n)}(e,t.discriminator,r,s,n);let i=[];const o=new xt;for(let a=0,{length:c}=t.oneOf;a<c;a++){const c=`${r}.oneOf[${a}]`,u=Pt(e,t.oneOf[a],c,s,n);u.isOk()?i.push(c):o.append(u)}if(0===i.length)return o.prepend(new bt(`Data at ${r} did not match any subschema in oneOf.`)),o.toValidationResponse();if(i.length>1)return o.prepend(new bt(`Data at ${r} matched multiple subschemas: [${i.join(", ")}].`)),o.toValidationResponse();return It()}(e,t,r,s,n)):"allOf"in t?o.append(function(e,t,r,s,n){let i=!0;const o=new xt;for(let a=0,{length:c}=t.allOf;a<c;a++){const c=Pt(e,t.allOf[a],`${r}.allOf[${a}]`,s,n);c.isOk()||(o.append(c),i=!1)}i||o.prepend(new bt(`Data at ${r} did not match some subschemas in allOf.`));return o.toValidationResponse()}(e,t,r,s,n)):"not"in t?o.append(function(e,t,r,s,n){const i=Pt(e,t.not,r,s,n);if(i.isOk())return At(new bt(`Data at ${r} validated against the schema of a not clause.`));return It()}(e,t,r,s,n)):"$ref"in t?o.append(function(e,t,r,s,n){if(!t.$ref.startsWith("#"))return At(new Tt("$ref values that do not refer to the current document are unsupported (must start with '#')"));let i=n.get(e);if(void 0!==i&&i.has(t.$ref))return It();void 0===i&&(i=new Set,n.set(e,i));i.add(t.$ref);try{const i=function(e,t){if("#"===t)return e;const r=t.replace(/^#\//,"").split("/");let s=e,n="#";for(const e of r){if(n=`${n}/${e}`,void 0===s[e])throw new Tt(`Invalid $ref value '${t}'. Cannot find target schema at '${n}'`);s=s[e]}return s}
214/*!
215   * Copyright (c) 2022, Salesforce, Inc.,
216   * All rights reserved.
217   * For full license text, see the LICENSE.txt file
218   */(s,t.$ref);return Pt(e,i,r,s,n)}catch(e){return At(e)}finally{i.delete(t.$ref),0===i.size&&n.delete(e)}}(e,t,r,s,n)):"type"in t&&("object"===t.type?"object"!==i?o.add(St("object",i,r)):o.append(function(e,t,r,s,n){const i=Object.keys(t.properties),o=new Set(t.required),a=new Set(i),c=new xt;Object.keys(e).forEach(i=>
218{a.has(i)||c.append(Pt(e[i],t.additionalProperties,`${r}.additionalProperties[${i}]`,s,n))});for(let a=0,u=i.length;a<u;a++){const u=i[a],h=u in e&&void 0!==e[u];o.has(u)&&!h&&c.add(new Et(`Object at path '${r}' is missing required property '${u}'.`)),h&&c.append(Pt(e[u],t.properties[u],`${r}.${u}`,s,n))}return c.toValidationResponse()}(e,t,r,s,n)):"array"===t.type?"array"!==i?o.add(St("array",i,r)):o.append(function(e,t,r,s,n){if(void 0!==t.minItems&&e.length<t.minItems)return At(new wt(`Array at path '${r}' fails minItems constraint. Has ${e.length} items, needs at least ${t.minItems}.`));if(void 0!==t.maxItems&&e.length>t.maxItems)return At(new kt(`Array at path '${r}' fails maxItems constraint. Has ${e.length} items, needs at most ${t.maxItems}.`));const i=new xt;return e.forEach((e,o)=>i.append(Pt(e,t.items,`${r}[${o}]`,s,n))),i.toValidationResponse()}(e,t,r,s,n)):o.append(function(e,t,r){const s=t.type,n=typeof e;if("integer"===s){if("number"!==n||!Number.isInteger(e))return At(St("integer",n,r))}else if("number"===s){if("number"!==n)return At(St("number",n,r))}else if("string"===s){if("string"!==n)return At(St("string",n,r))}else if("boolean"===s){if("boolean"!==n)return At(St("boolean",n,r))}else{if("null"!==s)return At(new Ct(`Unknown schema data type: ${s}.`));if(null!==e)return At(St("null",n,r))}return It()}(e,t,r))),t.enum&&o.append(function(e,t,r){if(!t.some(t=>j(t,e)))return At(new bt(`Data at ${r} did not match any values in enum. Expected value in: [${t.map(e=>T(e)).join()}]`));return It()}(e,t.enum,r)),t.const&&o.append(function(e,t,r){if(!j(t,e))return At(new bt(`Data at ${r} did not match const. Expected: ${T(t)}`));return It()}(e,t.const,r)),o.toValidationResponse()}function Nt(e){return e instanceof Error&&"type"in e&&"user-visible"===e.type}function Ft(e,t){$t(t),e({data:void 0,error:qt(t)})}function qt(e){return Nt(e)?e.data:new Error("Internal error in Lightning Data Service adapter occurred.")}function $t(e){Nt(e)||console.error("OneStore Command threw an error that we did not expect",e)}
219/*!
220   * Copyright (c) 2022, Salesforce, Inc.,
221   * All rights reserved.
222   * For full license text, see the LICENSE.txt file
223   */function Ut(e,t){return async(...r)=>{const s=e({params:r,assertIsValid:Ot});try{return s.execute().then(e=>t(e))}catch(e){!function(e){throw $t(e),qt(e)}(e)}}}const Dt=["no-cache","only-if-cached"];function jt(e){return function(e){return"object"==typeof e&&null!==e&&"cachePolicy"in e&&"object"==typeof e.cachePolicy&&null!==e.cachePolicy&&"type"in e.cachePolicy&&"string"==typeof e.cachePolicy.type&&Dt.includes(e.cachePolicy.type)}(e)?{cacheControlConfig:{type:e.cachePolicy.type}}:{}}function Lt(e,t){const r={data:void 0,errors:void 0};if(e.isOk())r.data=e.value.data;else{const{data:t,errors:s}=Mt(e.error);r.data=t,r.errors=s}t(r)}function Mt(e){return W(e)?{data:e.data.data,errors:e.data.errors}:(J(e),{data:void 0,errors:[{message:"Internal error in GraphQL adapter occurred",locations:[]}]})}class Ht{bind(e){return Ut(e,e=>{if(e.isOk())return Q(e.value),F(e)?e.value.data:e.value;throw M(F(e)?e.error.failure:e.error)})}}class Bt{bind(e){return Ut(e,e=>{if(e.isOk())return Q(e.value),F(e)?{data:e.value.data}:{data:e.value};throw M(F(e)?e.error.failure:e.error)})}}class _t{bind(e,t=!1){return Ut(e,e=>this.transformResult(e,t))}transformResult(e,t=!1){if(!F(e))throw console.error("Non-subscribable result encountered - please use correct operation type"),new Error("Internal error in Lightning Data Service adapter occurred");if(e.isOk()){Q(e.value.data);const r={data:e.value.data,subscribe:t=>{e.value.subscribe(e=>e.isErr()?t({data:void 0,error:M(e.error)}):t({data:e.value,error:void 0}))}};return t?{...r,refresh:()=>e.value.refresh().then(e=>{if(!e.isOk())throw e.error})}:r}throw M(e.error.failure)}}class Qt{bind(e){return{invoke:async(t,r,s)=>{const n=e({config:t,assertIsValid:Ot});try{const e=jt(r),t=await n.execute(e);t.isOk()?(Q(t.value),s({data:t.value.data,error:void 0})):s({data:void 0,error:M(t.error.failure)})}catch(e){Ft(s,e)}},subscribe:(t,r,s)=>{const n=e({config:t,assertIsValid:Ot});let i=()=>{};try{const e=jt(r);n.execute(e).then(e=>{e.isOk()?(i=e.value.subscribe(e=>{e.isOk()?s({data:e.value,error:void 0}):s({data:void 0,error:M(e.error)})}),s({data:e.value.data,error:void 0})):s({data:void 0,error:M(e.error.failure)})},e=>{Ft(s,e)})}catch(e){Ft(s,e)}return()=>{i()}}}}}class Vt{bind(e,t=!1){return async(...r)=>{try{if(r.length){const e={acceptedOperations:["query"]},t=n.resolveAndValidateGraphQLConfig(r[0],e);if(null==t?void 0:t.isErr())return t.error;(null==t?void 0:t.isOk())&&(r[0]=t.value)}return await Ut(e,e=>this.transformResult(e,t))(...r)}catch(e){return J(e),{data:void 0,errors:[{message:"Internal error in GraphQL adapter occurred",locations:[]}]}}}}transformResult(e,t=!1){const r={data:void 0,errors:void 0};if(e.isOk())Q(e.value),r.data=e.value.data.data,r.subscribe=t=>{e.value.subscribe(e=>{const r={data:void 0,errors:void 0};e.isOk()?r.data=e.value.data:W(e.error)?(r.data=e.error.data.data,r.errors=e.error.data.errors):(J(e.error),r.errors=[{message:"Internal error in GraphQL adapter occurred",locations:[]}]),t(r)})},t&&(r.refresh=()=>new Promise((t,r)=>{try{e.value.refresh().then(e=>{e.isOk()?t():r(new Error("Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"))})}catch(e){J(e),r(new Error("Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"))}}));else{const t=Mt(e.error.failure);r.data=t.data,r.errors=t.errors}return r}}class Gt{bind(e){return{invoke:async(t,r,s)=>{if(t){const e={acceptedOperations:["query"]},r=n.resolveAndValidateGraphQLConfig(t,e);if(null==r?void 0:r.isErr())return void s(r.error);(null==r?void 0:r.isOk())&&(t=r.value)}const i=e({config:t,assertIsValid:Ot});try{const e=jt(r),t=await i.execute(e),n={data:void 0,errors:void 0};if(t.isOk())Q(t.value),n.data=t.value.data.data;else{const{data:e,errors:r}=Mt(t.error.failure);n.data=e,n.errors=r}s(n)}catch(e){J(e),s({data:void 0,errors:[{message:"Internal error in GraphQL adapter occurred",locations:[]}]})}},subscribe:(t,r,s)=>{if(t){const e={acceptedOperations:["query"]},r=n.resolveAndValidateGraphQLConfig(t,e);if(null==r?void 0:r.isErr())return s(r.error),()=>{};(null==r?void 0:r.isOk())&&(t=r.value)}const i=e({config:t,assertIsValid:Ot});let o=()=>{};const a=jt(r);return i.execute(a).then(e=>{const t={data:void 0,errors:void 0};if(e.isOk())Q(e.value),t.data=e.value.data.data,o=e.value.subscribe(e=>{Lt(e,s)});else{const{data:r,errors:n}=Mt(e.error.failure);t.data=r,t.errors=n,o=e.error.subscribe(e=>{Lt(e,s)})}s(t)}),()=>{o()}}}}}class Wt{bind(e){return async(...t)=>{try{if(t.length){const e={acceptedOperations:["mutation"]},r=n.resolveAndValidateGraphQLConfig(t[0],e);if(null==r?void 0:r.isErr())return{data:void 0,errors:r.error.errors};(null==r?void 0:r.isOk())&&(t[0]=r.value)}const r=e({params:t,assertIsValid:Ot}),s=await r.execute({cacheControlConfig:{type:"no-cache"}});return s.isOk()?(Q(s.value),s.value.data):Mt(s.error.failure)}catch(e){return J(e),{data:void 0,errors:[{message:"Internal error in GraphQL adapter occurred",locations:[]}]}}}}}
224/*!
225   * Copyright (c) 2022, Salesforce, Inc.,
226   * All rights reserved.
227   * For full license text, see the LICENSE.txt file
228   */
229class Jt{constructor(e){this.obj=e,this.copy={}
229,this.currentPath={key:"",value:e,parent:null,data:this.copy}}sanitize(){const e=this;return JSON.stringify(this.obj,function(t,r){if(""===t)return r;const s=this;return s!==e.currentPath.value&&e.exit(s),"object"==typeof r&&null!==r?(e.enter(t,r),r):(e.currentPath.data[t]=r,r)}),this.copy}enter(e,t){const{currentPath:r}=this,s=r.data[e]=Array.isArray(t)?[]:{};this.currentPath={key:e,value:t,parent:r,data:s}}exit(e){for(;this.currentPath.value!==e;)this.currentPath=this.currentPath.parent||this.currentPath}}function zt(e){return new Jt(e).sanitize()}class Kt{constructor(e,t,r){this.callback=e,this.connected=!1,this.exposeRefresh=!1,(null==r?void 0:r.skipEmptyEmit)||this.emit()}connect(){this.connected=!0,this.invokeAdapter()}disconnect(){this.unsubscribe(),this.connected=!1}update(e,t){this.unsubscribe(),this.config=zt(e),this.invokeAdapter()}emit(e){try{if(void 0===e)this.callback({data:void 0,error:void 0});else{const t=()=>this.refresh?new Promise((e,t)=>{this.refresh?this.refresh().then(r=>{r.isOk()?e():t(new Error("Internal error in Lightning Data Service adapter occurred: Failed to refresh data"))}):e()}):Promise.resolve();let r={data:void 0,error:void 0};this.exposeRefresh&&this.refresh&&(r.refresh=t),e.isErr()?F(e)?r.error=e.error.failure:r.error=e.error:F(e)?(Q(e.value.data),r.data=e.value.data):(Q(e.value),r.data=e.value),this.callback(r)}}catch(e){this.handleExecutionThrow(e)}}invokeAdapter(){if(!this.connected||void 0===this.config)return;if(this.configSchema)try{Ot(this.config,this.configSchema)}catch(e){if(function(e){return e instanceof Et||e instanceof bt&&void 0!==e.validationErrors.find(e=>e instanceof Et)}(e))return;throw e}const e=this.config,t=this.getCommand();try{t.execute().then(t=>{if(this.connected&&this.config===e)if(this.refresh=void 0,t.isOk())if(F(t)){const r=t.value;this.unsubscriber=r.subscribe(t=>{this.connected&&this.config===e?this.emit(t):this.unsubscribe()}),this.refresh=r.refresh,this.emit(P(r.data))}else this.emit(t);else if(F(t)){const r=t.error;this.unsubscriber=r.subscribe(t=>{this.connected&&this.config===e?this.emit(t):this.unsubscribe()}),this.refresh=r.refresh,this.emit(t)}else this.unsubscriber=()=>{},this.emit(t)})}catch(e){this.handleExecutionThrow(e)}}handleExecutionThrow(e){Ft(this.callback,e)}unsubscribe(){this.unsubscriber&&(this.unsubscriber(),delete this.unsubscriber)}}class Xt{bind(e,t,r=!1){return class extends Kt{constructor(){super(...arguments),this.configSchema=t,this.exposeRefresh=r}getCommand(){return e(this.config)}}}}class Yt extends Kt{emit(e){try{if(void 0===e)this.callback({data:void 0,errors:void 0});else{const t=()=>this.refresh?new Promise((e,t)=>{this.refresh?this.refresh().then(r=>{r.isOk()||W(r.error)?e():t(new Error("Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"))}):e()}):Promise.resolve();let r={data:void 0,errors:void 0};if(this.exposeRefresh&&this.refresh&&(r.refresh=t),e.isErr()){const t=function(e){return W(e)?{data:e.data.data,errors:e.data.errors}:(J(e),{data:void 0,errors:[{message:"Internal error in GraphQL adapter occurred",locations:[]}]})}(F(e)?e.error.failure:e.error);r.data=t.data,r.errors=t.errors}else r.data=e.value.data;Q(r),this.callback(r)}}catch(e){J(e),this.handleExecutionThrow(e)}}handleExecutionThrow(e){J(e),this.callback({data:void 0,errors:[{message:"Internal error in GraphQL adapter occurred",locations:[]}]})}update(e,t){this.unsubscribe();const r=n.resolveAndValidateGraphQLConfig(e,{acceptedOperations:["query"]});if(!r)return;if(r.isErr()){const e=r.error;return void this.callback({data:void 0,errors:e.errors})}const{query:s,...i}=r.value;this.config={query:s,...zt(i)},this.invokeAdapter()}}class Zt{bind(e,t,r=!1){return class extends Yt{constructor(){super(...arguments),this.configSchema=t,this.exposeRefresh=r}getCommand(){return e(this.config)}}}}
230/*!
231   * Copyright (c) 2022, Salesforce, Inc.,
232   * All rights reserved.
233   * For full license text, see the LICENSE.txt file
234   */
235function er(e){this.message=e}er.prototype=new Error,er.prototype.name="InvalidCharacterError";var tr="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new er("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,s,n=0,i=0,o="";s=t.charAt(i++);~s&&(r=n%4?64*r+s:s,n++%4)?o+=String.fromCharCode(255&r>>(-2*n&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
235+/=".indexOf(s);return o};function rr(e){this.message=e}function sr(e,t){if("string"!=typeof e)throw new rr("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(tr(t).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return tr(t)}}(e.split(".")[r]))}catch(e){throw new rr("Invalid token specified: "+e.message)}}rr.prototype=new Error,rr.prototype.name="InvalidTokenError";class nr{constructor(e,t,r,s){this._token=e,this._decodedInfo=t,this._extraInfo=r,this._mintParams=s}get token(){return this._token}get extraInfo(){return this._extraInfo}get decodedInfo(){return this._decodedInfo}get mintParams(){return this._mintParams}get tokenRemainingSeconds(){return this.decodedInfo.exp-Date.now()/1e3}get isExpired(){return this.tokenRemainingSeconds<=0}}function ir(e){return void 0===e?"jwt:":`jwt:${L(e)??""}`}let or,ar={trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}};
236/*!
237   * Copyright (c) 2022, Salesforce, Inc.,
238   * All rights reserved.
239   * For full license text, see the LICENSE.txt file
240   */
241function cr(e={request:[],retry:void 0,response:[],finally:[]},t){return{type:"fetch",version:"1.0",service:function(r,s){var n;let i,o=s;if(void 0!==s&&"__contextSeed"in s){const{__contextSeed:e,...t}=s;i=e,o=0===Object.keys(t).length?void 0:t}const a=void 0===o?[r]:[r,o],c=null==(n=e.createContext)?void 0:n.call(e),u=void 0===i?c:{...c,...i},{request:h=[],retry:l,response:d=[],finally:f=[]}=e,p=h.reduce((e,t)=>e.then(e=>t(e,u)),$(a));return Promise.resolve(p).then(e=>l?l(e,t,u):fetch(...e)).then(e=>d.reduce((e,t)=>e.then(e=>t(e,u)),$(e))).finally(()=>{if(f.length>0)return f.reduce((e,t)=>e.then(()=>t(u)),Promise.resolve())})}}}function ur(e){const t=e.threshold??1024;return async r=>{const[s,n={}]=r;if(!n.body||"string"!=typeof n.body)return $(r);if("undefined"==typeof CompressionStream)return $(r);const i=new Headers(n.headers);if(i.has("Content-Encoding"))return $(r);const o=function(){if(!or){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available in this environment. Request body compression requires TextEncoder support.");or=new TextEncoder}return or}().encode(n.body);if(o.byteLength<t)return $(r);try{const t=new Blob([o]).stream().pipeThrough(new CompressionStream(e.algorithm)),r=await new Response(t).blob();i.set("Content-Encoding",e.algorithm),i.delete("Content-Length");return $([s,{...n,body:r,headers:i}])}catch{return $(r)}}}function hr({token:e},t){return function(e,t,[r,s={}],{throwOnExisting:n=!1,errorMessage:i=`Unexpected ${e} header encountered`}={}){let o=!1;if(r instanceof Request&&!(null==s?void 0:s.headers)){if(n&&r.headers.has(e))throw new Error(i);r.headers.set(e,t),o=!0}
241if((null==s?void 0:s.headers)instanceof Headers){if(n&&s.headers.has(e))throw new Error(i);s.headers.set(e,t)}else{if(n&&(null==s?void 0:s.headers)&&Reflect.has(s.headers,e))throw new Error(i);o||(s.headers={...null==s?void 0:s.headers,[e]:t})}return[r,s]}("Authorization",`Bearer ${e}`,t,{throwOnExisting:!0,errorMessage:"Unexpected Authorization header encountered. To specify a custom Authorization header, use a Fetch service that is not configured with JwtRequestHeaderInterceptor"})}const lr={getJwt:()=>new Promise(e=>{a.getSfapJwt().then(t=>{e({jwt:t.jwt,extraInfo:{baseUri:t.baseUri}})})})},dr=["POST","PATCH","PUT","DELETE"];async function fr(e){const[r,s]=e;if(!("string"==typeof r||r instanceof URL))return $(e);const n=function(e,t){const r=new URL(e,location?.href);t&&!r.pathname.startsWith(t)&&(r.pathname=t+r.pathname);return r}(r,b.default);return n.searchParams.append("language",v.default),n.searchParams.append("asGuest",(!(m.default||y.default||document.cookie.split(";").some(e=>e.trim().startsWith(`${g.default}=`)))).toString()),n.searchParams.append("htmlEncode","false"),e[0]=n,s?.method&&dr.includes(s.method)&&await async function(e){const{csrfToken:r}=await async function(){if("undefined"==typeof window)return{isGuest:!0,id:null,csrfToken:null};const{default:e}=await t.load("@app/user");return e}();e.headers||(e.headers={});r&&(e.headers["CSRF-Token"]=r)}(s),$(e)}const pr="api.salesforce.com",vr=new class{constructor(e=5,t=120,r=ar){this.limitInSeconds=e,this.defaultTokenTTLInSeconds=t,this.logger=r,this._tokens=new Map,this.timeoutHandlers=new Map,this.observers=[]}get token(){return this.getToken()}getToken(e){return this._tokens.get(ir(e))}setToken(e,t,r){const s=function(e,t,r){const s=sr(e);return void 0===s.exp&&(r.warn('"exp" claim is not present in the provided token.'),s.exp=Date.now()/1e3+t),s}(e,this.defaultTokenTTLInSeconds,this.logger),n=ir(r),i=new nr(e,s,t,r);return this._tokens.set(n,i),this.observeTokenExpiration(n),i}removeToken(e){const t=ir(e);this._tokens.delete(t),this.clearTimeoutHandler(t)}clearAllTokens(){for(const e of Array.from(this.timeoutHandlers.keys()))this.clearTimeoutHandler(e);this._tokens.clear()}subscribeToTokenNearExpiration(e){this.observers.push(e);for(const e of this._tokens.keys())this.observeTokenExpiration(e);return()=>{if(this.observers=this.observers.filter(t=>t!==e),0===this.observers.length)for(const e of Array.from(this.timeoutHandlers.keys()))this.clearTimeoutHandler(e)}}get size(){return this._tokens.size}clearTimeoutHandler(e){const t=this.timeoutHandlers.get(e);void 0!==t&&(clearTimeout(t),this.timeoutHandlers.delete(e))}observeTokenExpiration(e){this.clearTimeoutHandler(e);const t=this._tokens.get(e);if(0===this.observers.length||void 0===t)return;const r=setTimeout(()=>this.notifyTokenIsExpiring(e),this.computeTimeoutTimeInMs(t));this.timeoutHandlers.set(e,r)}computeTimeoutTimeInMs(e){const t=e.tokenRemainingSeconds-this.limitInSeconds;return t<0?0:1e3*t}notifyTokenIsExpiring(e){const t=this._tokens.get(e);void 0!==t&&this.observers.forEach(e=>{try{e.call(void 0,t)}catch(e){this.logger.error(e.message)}})}},mr=new class{constructor(e,t,r){this.jwtRepository=e,this.resolver=t,this.inflightPromises=new Map,(null==r?void 0:r.keepTokenUpdated)&&e.subscribeToTokenNearExpiration(e=>this.refreshToken(e.mintParams))}getJwt(e){const t=ir(e),r=this.inflightPromises.get(t);if(r)return r;const s=this.jwtRepository.getToken(e);return void 0===s||s.isExpired?this.refreshToken(e):s}refreshToken(e){const t=ir(e),r=this.inflightPromises.get(t);if(void 0!==r)return r;const s=void 0===e?this.resolver.getJwt():this.resolver.getJwt(e),n=new Promise((r,n)=>{s.then(({jwt:s,extraInfo:n})=>{this.inflightPromises.delete(t);const i=this.jwtRepository.setToken(s,n,e);r(i)}).catch(e=>{this.inflightPromises.delete(t),n(e)})});return this.inflightPromises.set(t,n),n}get isRefreshingToken(){return this.inflightPromises.size>0}}(vr,lr);function yr(e){return{...cr({request:[br(e)]}),tags:{authenticationScopes:"sfap_api"}}}function gr(e){return{...cr({request:[t=>{const[r,s]=t;return"string"==typeof r&&r.endsWith("/sessions")&&s&&"POST"===s.method&&s.body&&"string"==typeof s.body?$(mr.getJwt()).then(r=>{const n=JSON.parse(s.body);return n&&r.decodedInfo&&r.decodedInfo.iss?(n.instanceConfig||(n.instanceConfig={}),n.instanceConfig.endpoint=r.decodedInfo.iss):e.warn("skipping injection of endpoint into start session request"),[t[0],{...t[1],body:JSON.stringify(n)}]}):$(t)},br(e)]}),tags:{specialHacksFor:"copilot"}}}function br(e){const t=function(e,t=(e,t)=>t){return r=>$(e.getJwt()).then(e=>{const s=hr(e,r);return e.extraInfo?t(e.extraInfo,s):s})}(mr,({baseUri:t},[r,s])=>{if("string"!=typeof r&&!(r instanceof URL))return[r,s];const n=new URL(t),i="string"==typeof r?new URL(r):new URL(r.toString());return i.host!==pr?(e.warn(`SFAP fetch service requires that the host of the resource is ${pr}`),[r,s]):(i.host=n.host,i.protocol=n.protocol,[i,s])});return t}const wr=new class{constructor(e="WARN",t=console.log,r=(e,t)=>`${e}: ${t}`){this.level=e,this.printer=t,this.formatter=r,this.messages=[]}trace(e){this.log("TRACE",e)}debug(e){this.log("DEBUG",e)}info(e){this.log("INFO",e)}warn(e){this.log("WARN",e)}error(e){this.log("ERROR",e)}log(e,t){S[e]>S[this.level]||this.printer(this.formatter(e,t))}}("ERROR"),kr={type:"cache",version:"1.0",service:new Qe},Cr={type:"instrumentation",version:"1.0",service:new De({logger:wr})};const Rr={service:new at({cache:kr.service}),type:"cacheInclusionPolicy",version:"1.0"};
241const Er={version:"1.0",service:new ct,type:"featureFlags"};Er.service.set("useOneStoreGraphQL",!1);function Tr(e){return t=t=>(e=>function(t){const r=t.map(e=>`UiApi::RecordRepresentation:${e.recordId}`);return e.notifyStoreUpdateAvailable(r)})(e)(t),{type:"luvioUiapiRecords",version:"1.0",service:{notifyRecordUpdateAvailable:t,getNormalizedLuvioRecord:(e,t)=>{const r=`UiApi::RecordRepresentation:${e}`;t.markSeenId(r);const s=t.read({recordId:r,node:{kind:"Fragment",private:[],opaque:!0,version:"98c5b18512e48ca8d28727549507e4ba"},variables:{}});return t.unMarkMissing(),s.data}}};var t}o.withDefaultLuvio(e=>{const t=[Cr,{...cr({request:[fr]}),tags:{authenticationScopes:""}},{...cr({request:[fr,ur({algorithm:"gzip"})]}),tags:{compression:"gzip"}},yr(wr),gr(wr),(r=Cr.service,{type:"instrumentCommand",version:"1.0",service:Ee({instrumentation:r})}),Ke(kr.service,Rr.service,Cr.service),{type:"auraNetworkCommandBaseClass",version:"1.0",service:X},{type:"NDJSONCommandBaseClass",version:"1.0",service:mt},{type:"fetchNetworkCommandBaseClass",version:"1.0",service:be},{type:"networkCommandBaseClass",version:"1.0",service:K},{type:"streamingCommandBaseClass",version:"1.0",service:we},{type:"SSECommandBaseClass",version:"1.0",service:ke},{type:"auraResourceCacheControlCommand",version:"1.0",service:de},{type:"auraNormalizedCacheControlCommand",version:"1.0",service:pe},{type:"httpNormalizedCacheControlCommand",version:"1.0",service:me},{type:"pubSub",version:"1.0",service:new Ye},{type:"auraGraphQLNormalizedCacheControlCommand",version:"1.0",service:pt},{type:"httpGraphQLNormalizedCacheControlCommand",version:"1.0",service:vt},Er,gt(e),Tr(e),{type:"defaultImperativeBindings",version:"1.0",service:new Ht},{type:"queryImperativeBindings",version:"1.0",service:new Bt},{type:"subscribableImperativeBindings",version:"1.0",service:new _t},{type:"legacyImperativeBindings",version:"1.0",service:new Qt},{type:"graphQLImperativeBindings",version:"1.0",service:new Vt},{type:"graphQLLegacyImperativeBindings",version:"1.0",service:new Gt},{type:"graphQLMutationBindings",version:"1.0",service:new Wt},{type:"lwcWireBindings",version:"1.0",service:new Xt},{type:"lwcGraphQLWireBindings",version:"1.0",service:new Zt}];var r;i.setServices(t)}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"resolve",{enumerable:!0,get:function(){return i.resolve}}),Object.defineProperty(e,"setServices",{enumerable:!0,get:function(){return i.setServices}}),Object.defineProperty(e,"__esModule",{value:!0})});
242})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.