Unknown Log

#HaD1YFT
1 line
Raw
1es(h)||d.push(h);const f=[];for(const h of l){const b=u[h],B=s.data[h];f.push({key:{status:\"valid\",value:h},value:b._parse(new Y(s,B,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof q){const h=this._def.unknownKeys;if(h===\"passthrough\")for(const b of d)f.push({key:{status:\"valid\",value:b},value:{status:\"valid\",value:s.data[b]}});else if(h===\"strict\")d.length>0&&(v(s,{code:y.unrecognized_keys,keys:d}),o.dirty());else if(h!==\"strip\")throw new Error(\"Internal ZodObject error: invalid unknownKeys value.\")}else{const h=this._def.catchall;for(const b of d){const B=s.data[b];f.push({key:{status:\"valid\",value:b},value:h._parse(new Y(s,B,s.path,b)),alwaysSet:b in s.data})}}return s.common.async?Promise.resolve().then(async function(){const h=[];for(const b of f){const B=await b.key;h.push({key:B,value:await b.value,alwaysSet:b.alwaysSet})}return h}).then(function(h){return U.mergeObjectSync(o,h)}):U.mergeObjectSync(o,f)}},{key:\"shape\",get:function(){return this._def.shape()}},{key:\"strict\",value:function(t){var a=this;return _.errToObj,new n({...this._def,unknownKeys:\"strict\",...t!==void 0?{errorMap:function(o,s){var u,l,d,f;const h=(d=(l=(u=a._def).errorMap)===null||l===void 0?void 0:l.call(u,o,s).message)!==null&&d!==void 0?d:s.defaultError;return o.code===\"unrecognized_keys\"?{message:(f=_.errToObj(t).message)!==null&&f!==void 0?f:h}:{message:h}}}:{}})}},{key:\"strip\",value:function(){return new n({...this._def,unknownKeys:\"strip\"})}},{key:\"passthrough\",value:function(){return new n({...this._def,unknownKeys:\"passthrough\"})}},{key:\"extend\",value:function(t){var a=this;return new n({...this._def,shape:function(){return{...a._def.shape(),...t}}})}},{key:\"merge\",value:function(t){var a=this;return new n({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:function(){return{...a._def.shape(),...t._def.shape()}},typeName:k.ZodObject})}},{key:\"setKey\",value:function(t,a){return this.augment({[t]:a})}},{key:\"catchall\",value:function(t){return new n({...this._def,catchall:t})}},{key:\"pick\",value:function(t){var a=this;const o={};return P.objectKeys(t).forEach(function(s){t[s]&&a.shape[s]&&(o[s]=a.shape[s])}),new n({...this._def,shape:function(){return o}})}},{key:\"omit\",value:function(t){var a=this;const o={};return P.objectKeys(this.shape).forEach(function(s){t[s]||(o[s]=a.shape[s])}),new n({...this._def,shape:function(){return o}})}},{key:\"deepPartial\",value:function(){return me(this)}},{key:\"partial\",value:function(t){var a=this;const o={};return P.objectKeys(this.shape).forEach(function(s){const u=a.shape[s];t&&!t[s]?o[s]=u:o[s]=u.optional()}),new n({...this._def,shape:function(){return o}})}},{key:\"required\",value:function(t){var a=this;const o={};return P.objectKeys(this.shape).forEach(function(s){if(t&&!t[s])o[s]=a.shape[s];else{let l=a.shape[s];for(;l instanceof X;)l=l._def.innerType;o[s]=l}}),new n({...this._def,shape:function(){return o}})}},{key:\"keyof\",value:function(){return Qt(P.objectKeys(this.shape))}}]),n}(S);z.create=function(e,i){return new z({shape:function(){return e},unknownKeys:\"strip\",catchall:q.create(),typeName:k.ZodObject,...E(i)})},z.strictCreate=function(e,i){return new z({shape:function(){return e},unknownKeys:\"strict\",catchall:q.create(),typeName:k.ZodObject,...E(i)})},z.lazycreate=function(e,i){return new z({shape:e,unknownKeys:\"strip\",catchall:q.create(),typeName:k.ZodObject,...E(i)})};let Ze=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t),o=this._def.options;function s(u){for(const d of u)if(d.result.status===\"valid\")return d.result;for(const d of u)if(d.result.status===\"dirty\")return a.common.issues.push(...d.ctx.common.issues),d.result;const l=u.map(function(d){return new J(d.ctx.common.issues)});return v(a,{code:y.invalid_union,unionErrors:l}),w}if(a.common.async)return Promise.all(o.map(async function(u){const l={...a,common:{...a.common,issues:[]},parent:null};return{result:await u._parseAsync({data:a.data,path:a.path,parent:l}),ctx:l}})).then(s);{let u;const l=[];for(const f of o){const h={...a,common:{...a.common,issues:[]},parent:null},b=f._parseSync({data:a.data,path:a.path,parent:h});if(b.status===\"valid\")return b;b.status===\"dirty\"&&!u&&(u={result:b,ctx:h}),h.common.issues.length&&l.push(h.common.issues)}if(u)return a.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(function(f){return new J(f)});return v(a,{code:y.invalid_union,unionErrors:d}),w}}},{key:\"options\",get:function(){return this._def.options}}]),n}(S);Ze.create=function(e,i){return new Ze({options:e,typeName:k.ZodUnion,...E(i)})};const Ke=function(e){return e instanceof $e?Ke(e.schema):e instanceof H?Ke(e.innerType()):e instanceof Le?[e.value]:e instanceof je?e.options:e instanceof Me?Object.keys(e.enum):e instanceof Ve?Ke(e._def.innerType):e instanceof De?[void 0]:e instanceof Oe?[null]:null};let qt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==m.object)return v(a,{code:y.invalid_type,expected:m.object,received:a.parsedType}),w;const o=this.discriminator,s=a.data[o],u=this.optionsMap.get(s);return u?a.common.async?u._parseAsync({data:a.data,path:a.path,parent:a}):u._parseSync({data:a.data,path:a.path,parent:a}):(v(a,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),w)}},{key:\"discriminator\",get:function(){return this._def.discriminator}},{key:\"options\",get:function(){return this._def.options}},{key:\"optionsMap\",get:function(){return this._def.optionsMap}}],[{key:\"create\",value:function(t,a,o){const s=new Map;for(const u of a){const l=Ke(u.shape[t]);if(!l)throw new Error(`A discriminator value for key \\`${t}\\` could not be extracted from all schema options`);for(const d of l){if(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,u)}}return new n({typeName:k.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:s,...E(o)})}}]),n}(S);function Rt(e,i){const n=ee(e),r=ee(i);if(e===i)return{valid:!0,data:e};if(n===m.object&&r===m.object){const t=P.objectKeys(i),a=P.objectKeys(e).filter(function(s){return t.indexOf(s)!==-1}),o={...e,...i};for(const s of a){const u=Rt(e[s],i[s]);if(!u.valid)return{valid:!1};o[s]=u.data}return{valid:!0,data:o}}else if(n===m.array&&r===m.array){if(e.length!==i.length)return{valid:!1};const t=[];for(let a=0;a<e.length;a++){const o=e[a],s=i[a],u=Rt(o,s);if(!u.valid)return{valid:!1};t.push(u.data)}return{valid:!0,data:t}}else return n===m.date&&r===m.date&&+e==+i?{valid:!0,data:e}:{valid:!1}}let Be=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t),s=function(u,l){if(_t(u)||_t(l))return w;const d=Rt(u.value,l.value);return d.valid?((bt(u)||bt(l))&&a.dirty(),{status:a.value,value:d.data}):(v(o,{code:y.invalid_intersection_types}),w)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(function(u){let[l,d]=u;return s(l,d)}):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}]),n}(S);Be.create=function(e,i,n){return new Be({left:e,right:i,typeName:k.ZodIntersection,...E(n)})};let te=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){var a=this;const{status:o,ctx:s}=this._processInputParams(t);if(s.parsedType!==m.array)return v(s,{code:y.invalid_type,expected:m.array,received:s.parsedType}),w;if(s.data.length<this._def.items.length)return v(s,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:\"array\"}),w;!this._def.rest&&s.data.length>this._def.items.length&&(v(s,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:\"array\"}),o.dirty());const l=[...s.data].map(function(d,f){const h=a._def.items[f]||a._def.rest;return h?h._parse(new Y(s,d,s.path,f)):null}).filter(function(d){return!!d});return s.common.async?Promise.all(l).then(function(d){return U.mergeArray(o,d)}):U.mergeArray(o,l)}},{key:\"items\",get:function(){return this._def.items}},{key:\"rest\",value:function(r){return new n({...this._def,rest:r})}}]),n}(S);te.create=function(e,i){if(!Array.isArray(e))throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");return new te({items:e,typeName:k.ZodTuple,rest:null,...E(i)})};let Xt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"keySchema\",get:function(){return this._def.keyType}},{key:\"valueSchema\",get:function(){return this._def.valueType}},{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t);if(o.parsedType!==m.object)return v(o,{code:y.invalid_type,expected:m.object,received:o.parsedType}),w;const s=[],u=this._def.keyType,l=this._def.valueType;for(const d in o.data)s.push({key:u._parse(new Y(o,d,o.path,d)),value:l._parse(new Y(o,o.data[d],o.path,d))});return o.common.async?U.mergeObjectAsync(a,s):U.mergeObjectSync(a,s)}},{key:\"element\",get:function(){return this._def.valueType}}],[{key:\"create\",value:function(t,a,o){return a instanceof S?new n({keyType:t,valueType:a,typeName:k.ZodRecord,...E(o)}):new n({keyType:he.create(),valueType:t,typeName:k.ZodRecord,...E(a)})}}]),n}(S),Qe=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"keySchema\",get:function(){return this._def.keyType}},{key:\"valueSchema\",get:function(){return this._def.valueType}},{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t);if(o.parsedType!==m.map)return v(o,{code:y.invalid_type,expected:m.map,received:o.parsedType}),w;const s=this._def.keyType,u=this._def.valueType,l=[...o.data.entries()].map(function(d,f){let[h,b]=d;return{key:s._parse(new Y(o,h,o.path,[f,\"key\"])),value:u._parse(new Y(o,b,o.path,[f,\"value\"]))}});if(o.common.async){const d=new Map;return Promise.resolve().then(async function(){for(const f of l){const h=await f.key,b=await f.value;if(h.status===\"aborted\"||b.status===\"aborted\")return w;(h.status===\"dirty\"||b.status===\"dirty\")&&a.dirty(),d.set(h.value,b.value)}return{status:a.value,value:d}})}else{const d=new Map;for(const f of l){const h=f.key,b=f.value;if(h.status===\"aborted\"||b.status===\"aborted\")return w;(h.status===\"dirty\"||b.status===\"dirty\")&&a.dirty(),d.set(h.value,b.value)}return{status:a.value,value:d}}}}]),n}(S);Qe.create=function(e,i,n){return new Qe({valueType:i,keyType:e,typeName:k.ZodMap,...E(n)})};let et=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t);if(o.parsedType!==m.set)return v(o,{code:y.invalid_type,expected:m.set,received:o.parsedType}),w;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(v(o,{code:y.too_small,minimum:s.minSize.value,type:\"set\",inclusive:!0,exact:!1,message:s.minSize.message}),a.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(v(o,{code:y.too_big,maximum:s.maxSize.value,type:\"set\",inclusive:!0,exact:!1,message:s.maxSize.message}),a.dirty());const u=this._def.valueType;function l(f){const h=new Set;for(const b of f){if(b.status===\"aborted\")return w;b.status===\"dirty\"&&a.dirty(),h.add(b.value)}return{status:a.value,value:h}}const d=[...o.data.values()].map(function(f,h){return u._parse(new Y(o,f,o.path,h))});return o.common.async?Promise.all(d).then(function(f){return l(f)}):l(d)}},{key:\"min\",value:function(t,a){return new n({...this._def,minSize:{value:t,message:_.toString(a)}})}},{key:\"max\",value:function(t,a){return new n({...this._def,maxSize:{value:t,message:_.toString(a)}})}},{key:\"size\",value:function(r,t){return this.min(r,t).max(r,t)}},{key:\"nonempty\",value:function(t){return this.min(1,t)}}]),n}(S);et.create=function(e,i){return new et({valueType:e,minSize:null,maxSize:null,typeName:k.ZodSet,...E(i)})};let Kt=function(e){A(n,e);var i=N(n);function n(){x(this,n);var r;return r=i.call(this,...arguments),r.validate=r.implement,r}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==m.function)return v(a,{code:y.invalid_type,expected:m.function,received:a.parsedType}),w;function o(d,f){return Ye({data:d,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,We(),Se].filter(function(h){return!!h}),issueData:{code:y.invalid_arguments,argumentsError:f}})}function s(d,f){return Ye({data:d,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,We(),Se].filter(function(h){return!!h}),issueData:{code:y.invalid_return_type,returnTypeError:f}})}const u={errorMap:a.common.contextualErrorMap},l=a.data;if(this._def.returns instanceof ve){const d=this;return V(async function(){for(var f=arguments.length,h=new Array(f),b=0;b<f;b++)h[b]=arguments[b];const B=new J([]),Re=await d._def.args.parseAsync(h,u).catch(function(Zt){throw B.addIssue(o(h,Zt)),B}),ie=await Reflect.apply(l,this,Re);return await d._def.returns._def.type.parseAsync(ie,u).catch(function(Zt){throw B.addIssue(s(ie,Zt)),B})})}else{const d=this;return V(function(){for(var f=arguments.length,h=new Array(f),b=0;b<f;b++)h[b]=arguments[b];const B=d._def.args.safeParse(h,u);if(!B.success)throw new J([o(h,B.error)]);const Re=Reflect.apply(l,this,B.data),ie=d._def.returns.safeParse(Re,u);if(!ie.success)throw new J([s(Re,ie.error)]);return ie.data})}}},{key:\"parameters\",value:function(){return this._def.args}},{key:\"returnType\",value:function(){return this._def.returns}},{key:\"args\",value:function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return new n({...this._def,args:te.create(a).rest(de.create())})}},{key:\"returns\",value:function(t){return new n({...this._def,returns:t})}},{key:\"implement\",value:function(t){return this.parse(t)}},{key:\"strictImplement\",value:function(t){return this.parse(t)}}],[{key:\"create\",value:function(t,a,o){return new n({args:t||te.create([]).rest(de.create()),returns:a||de.create(),typeName:k.ZodFunction,...E(o)})}}]),n}(S),$e=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"schema\",get:function(){return this._def.getter()}},{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}]),n}(S);$e.create=function(e,i){return new $e({getter:e,typeName:k.ZodLazy,...E(i)})};let Le=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){if(t.data!==this._def.value){const a=this._getOrReturnCtx(t);return v(a,{received:a.data,code:y.invalid_literal,expected:this._def.value}),w}return{status:\"valid\",value:t.data}}},{key:\"value\",get:function(){return this._def.value}}]),n}(S);Le.create=function(e,i){return new Le({value:e,typeName:k.ZodLiteral,...E(i)})};function Qt(e,i){return new je({values:e,typeName:k.ZodEnum,...E(i)})}let je=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){if(typeof t.data!=\"string\"){const a=this._getOrReturnCtx(t),o=this._def.values;return v(a,{expected:P.joinValues(o),received:a.parsedType,code:y.invalid_type}),w}if(this._def.values.indexOf(t.data)===-1){const a=this._getOrReturnCtx(t),o=this._def.values;return v(a,{received:a.data,code:y.invalid_enum_value,options:o}),w}return V(t.data)}},{key:\"options\",get:function(){return this._def.values}},{key:\"enum\",get:function(){const r={};for(const t of this._def.values)r[t]=t;return r}},{key:\"Values\",get:function(){const r={};for(const t of this._def.values)r[t]=t;return r}},{key:\"Enum\",get:function(){const r={};for(const t of this._def.values)r[t]=t;return r}},{key:\"extract\",value:function(t){return n.create(t)}},{key:\"exclude\",value:function(t){return n.create(this.options.filter(function(a){return!t.includes(a)}))}}]),n}(S);je.create=Qt;let Me=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const a=P.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==m.string&&o.parsedType!==m.number){const s=P.objectValues(a);return v(o,{expected:P.joinValues(s),received:o.parsedType,code:y.invalid_type}),w}if(a.indexOf(t.data)===-1){const s=P.objectValues(a);return v(o,{received:o.data,code:y.invalid_enum_value,options:s}),w}return V(t.data)}},{key:\"enum\",get:function(){return this._def.values}}]),n}(S);Me.create=function(e,i){return new Me({values:e,typeName:k.ZodNativeEnum,...E(i)})};let ve=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"unwrap\",value:function(){return this._def.type}},{key:\"_parse\",value:function(t){var a=this;const{ctx:o}=this._processInputParams(t);if(o.parsedType!==m.promise&&o.common.async===!1)return v(o,{code:y.invalid_type,expected:m.promise,received:o.parsedType}),w;const s=o.parsedType===m.promise?o.data:Promise.resolve(o.data);return V(s.then(function(u){return a._def.type.parseAsync(u,{path:o.path,errorMap:o.common.contextualErrorMap})}))}}]),n}(S);ve.create=function(e,i){return new ve({type:e,typeName:k.ZodPromise,...E(i)})};let H=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"innerType\",value:function(){return this._def.schema}},{key:\"sourceType\",value:function(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:\"_parse\",value:function(t){var a=this;const{status:o,ctx:s}=this._processInputParams(t),u=this._def.effect||null,l={addIssue:function(d){v(s,d),d.fatal?o.abort():o.dirty()},get path(){return s.path}};if(l.addIssue=l.addIssue.bind(l),u.type===\"preprocess\"){const d=u.transform(s.data,l);return s.common.issues.length?{status:\"dirty\",value:s.data}:s.common.async?Promise.resolve(d).then(function(f){return a._def.schema._parseAsync({data:f,path:s.path,parent:s})}):this._def.schema._parseSync({data:d,path:s.path,parent:s})}if(u.type===\"refinement\"){const d=function(f){const h=u.refinement(f,l);if(s.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");return f};if(s.common.async===!1){const f=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return f.status===\"aborted\"?w:(f.status===\"dirty\"&&o.dirty(),d(f.value),{status:o.value,value:f.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(function(f){return f.status===\"aborted\"?w:(f.status===\"dirty\"&&o.dirty(),d(f.value).then(function(){return{status:o.value,value:f.value}}))})}if(u.type===\"transform\")if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ce(d))return d;const f=u.transform(d.value,l);if(f instanceof Promise)throw new Error(\"Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.\");return{status:o.value,value:f}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(function(d){return Ce(d)?Promise.resolve(u.transform(d.value,l)).then(function(f){return{status:o.value,value:f}}):d});P.assertNever(u)}}]),n}(S);H.create=function(e,i,n){return new H({schema:e,typeName:k.ZodEffects,effect:i,...E(n)})},H.createWithPreprocess=function(e,i,n){return new H({schema:i,effect:{type:\"preprocess\",transform:e},typeName:k.ZodEffects,...E(n)})};let X=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){return this._getType(t)===m.undefined?V(void 0):this._def.innerType._parse(t)}},{key:\"unwrap\",value:function(){return this._def.innerType}}]),n}(S);X.create=function(e,i){return new X({innerType:e,typeName:k.ZodOptional,...E(i)})};let pe=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){return this._getType(t)===m.null?V(null):this._def.innerType._parse(t)}},{key:\"unwrap\",value:function(){return this._def.innerType}}]),n}(S);pe.create=function(e,i){return new pe({innerType:e,typeName:k.ZodNullable,...E(i)})};let Ve=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t);let o=a.data;return a.parsedType===m.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:a.path,parent:a})}},{key:\"removeDefault\",value:function(){return this._def.innerType}}]),n}(S);Ve.create=function(e,i){return new Ve({innerType:e,typeName:k.ZodDefault,defaultValue:typeof i.default==\"function\"?i.default:function(){return i.default},...E(i)})};let tt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){var a=this;const{ctx:o}=this._processInputParams(t),s={...o,common:{...o.common,issues:[]}},u=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Ge(u)?u.then(function(l){return{status:\"valid\",value:l.status===\"valid\"?l.value:a._def.catchValue({get error(){return new J(s.common.issues)},input:s.data})}}):{status:\"valid\",value:u.status===\"valid\"?u.value:this._def.catchValue({get error(){return new J(s.common.issues)},input:s.data})}}},{key:\"removeCatch\",value:function(){return this._def.innerType}}]),n}(S);tt.create=function(e,i){return new tt({innerType:e,typeName:k.ZodCatch,catchValue:typeof i.catch==\"function\"?i.catch:function(){return i.catch},...E(i)})};let nt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){if(this._getType(t)!==m.nan){const o=this._getOrReturnCtx(t);return v(o,{code:y.invalid_type,expected:m.nan,received:o.parsedType}),w}return{status:\"valid\",value:t.data}}}]),n}(S);nt.create=function(e){return new nt({typeName:k.ZodNaN,...E(e)})};const mr=Symbol(\"zod_brand\");let en=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t),o=a.data;return this._def.type._parse({data:o,path:a.path,parent:a})}},{key:\"unwrap\",value:function(){return this._def.type}}]),n}(S),wt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){var a=this;const{status:o,ctx:s}=this._processInputParams(t);if(s.common.async)return async function(){const l=await a._def.in._parseAsync({data:s.data,path:s.path,parent:s});return l.status===\"aborted\"?w:l.status===\"dirty\"?(o.dirty(),Yt(l.value)):a._def.out._parseAsync({data:l.value,path:s.path,parent:s})}();{const u=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return u.status===\"aborted\"?w:u.status===\"dirty\"?(o.dirty(),{status:\"dirty\",value:u.value}):this._def.out._parseSync({data:u.value,path:s.path,parent:s})}}}],[{key:\"create\",value:function(t,a){return new n({in:t,out:a,typeName:k.ZodPipeline})}}]),n}(S),rt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const a=this._def.innerType._parse(t);return Ce(a)&&(a.value=Object.freeze(a.value)),a}}]),n}(S);rt.create=function(e,i){return new rt({innerType:e,typeName:k.ZodReadonly,...E(i)})};const tn=function(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return e?ge.create().superRefine(function(r,t){var a,o;if(!e(r)){const s=typeof i==\"function\"?i(r):typeof i==\"string\"?{message:i}:i,u=(o=(a=s.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,l=typeof s==\"string\"?{message:s}:s;t.addIssue({code:\"custom\",...l,fatal:u})}}):ge.create()},vr={object:z.lazycreate};var k;(function(e){e.ZodString=\"ZodString\",e.ZodNumber=\"ZodNumber\",e.ZodNaN=\"ZodNaN\",e.ZodBigInt=\"ZodBigInt\",e.ZodBoolean=\"ZodBoolean\",e.ZodDate=\"ZodDate\",e.ZodSymbol=\"ZodSymbol\",e.ZodUndefined=\"ZodUndefined\",e.ZodNull=\"ZodNull\",e.ZodAny=\"ZodAny\",e.ZodUnknown=\"ZodUnknown\",e.ZodNever=\"ZodNever\",e.ZodVoid=\"ZodVoid\",e.ZodArray=\"ZodArray\",e.ZodObject=\"ZodObject\",e.ZodUnion=\"ZodUnion\",e.ZodDiscriminatedUnion=\"ZodDiscriminatedUnion\",e.ZodIntersection=\"ZodIntersection\",e.ZodTuple=\"ZodTuple\",e.ZodRecord=\"ZodRecord\",e.ZodMap=\"ZodMap\",e.ZodSet=\"ZodSet\",e.ZodFunction=\"ZodFunction\",e.ZodLazy=\"ZodLazy\",e.ZodLiteral=\"ZodLiteral\",e.ZodEnum=\"ZodEnum\",e.ZodEffects=\"ZodEffects\",e.ZodNativeEnum=\"ZodNativeEnum\",e.ZodOptional=\"ZodOptional\",e.ZodNullable=\"ZodNullable\",e.ZodDefault=\"ZodDefault\",e.ZodCatch=\"ZodCatch\",e.ZodPromise=\"ZodPromise\",e.ZodBranded=\"ZodBranded\",e.ZodPipeline=\"ZodPipeline\",e.ZodReadonly=\"ZodReadonly\"})(k||(k={}));const _r=function(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{message:`Input not instance of ${e.name}`};return tn(function(n){return n instanceof e},i)},nn=he.create,rn=Ae.create,br=nt.create,kr=Ne.create,an=Ie.create,Rr=Pe.create,wr=qe.create,Er=De.create,xr=Oe.create,Tr=ge.create,Sr=de.create,Cr=q.create,Ar=Xe.create,Nr=fe.create,Ir=z.create,Pr=z.strictCreate,Dr=Ze.create,Or=qt.create,Zr=Be.create,Br=te.create,$r=Xt.create,Lr=Qe.create,jr=et.create,Mr=Kt.create,Vr=$e.create,Ur=Le.create,zr=je.create,Jr=Me.create,Hr=ve.create,sn=H.create,Fr=X.create,Wr=pe.create,Yr=H.createWithPreprocess,Gr=wt.create;var O=Object.freeze({__proto__:null,defaultErrorMap:Se,setErrorMap:ar,getErrorMap:We,makeIssue:Ye,EMPTY_PATH:ir,addIssueToContext:v,ParseStatus:U,INVALID:w,DIRTY:Yt,OK:V,isAborted:_t,isDirty:bt,isValid:Ce,isAsync:Ge,get util(){return P},get objectUtil(){return vt},ZodParsedType:m,getParsedType:ee,ZodType:S,ZodString:he,ZodNumber:Ae,ZodBigInt:Ne,ZodBoolean:Ie,ZodDate:Pe,ZodSymbol:qe,ZodUndefined:De,ZodNull:Oe,ZodAny:ge,ZodUnknown:de,ZodNever:q,ZodVoid:Xe,ZodArray:fe,ZodObject:z,ZodUnion:Ze,ZodDiscriminatedUnion:qt,ZodIntersection:Be,ZodTuple:te,ZodRecord:Xt,ZodMap:Qe,ZodSet:et,ZodFunction:Kt,ZodLazy:$e,ZodLiteral:Le,ZodEnum:je,ZodNativeEnum:Me,ZodPromise:ve,ZodEffects:H,ZodTransformer:H,ZodOptional:X,ZodNullable:pe,ZodDefault:Ve,ZodCatch:tt,ZodNaN:nt,BRAND:mr,ZodBranded:en,ZodPipeline:wt,ZodReadonly:rt,custom:tn,Schema:S,ZodSchema:S,late:vr,get ZodFirstPartyTypeKind(){return k},coerce:{string:function(e){return he.create({...e,coerce:!0})},number:function(e){return Ae.create({...e,coerce:!0})},boolean:function(e){return Ie.create({...e,coerce:!0})},bigint:function(e){return Ne.create({...e,coerce:!0})},date:function(e){return Pe.create({...e,coerce:!0})}},any:Tr,array:Nr,bigint:kr,boolean:an,date:Rr,discriminatedUnion:Or,effect:sn,enum:zr,function:Mr,instanceof:_r,intersection:Zr,lazy:Vr,literal:Ur,map:Lr,nan:br,nativeEnum:Jr,never:Cr,null:xr,nullable:Wr,number:rn,object:Ir,oboolean:function(){return an().optional()},onumber:function(){return rn().optional()},optional:Fr,ostring:function(){return nn().optional()},pipeline:Gr,preprocess:Yr,promise:Hr,record:$r,set:jr,strictObject:Pr,string:nn,symbol:wr,transformer:sn,tuple:Br,undefined:Er,union:Dr,unknown:Sr,void:Ar,NEVER:w,ZodIssueCode:y,quotelessJson:rr,ZodError:J});const{View:qr,Text:Xr}=L.General,{FormSection:on}=L.Forms;let cn;const Kr=function(){const[e,i]=c.React.useReducer(function(r){return~r},0);cn=i;const n=c.stylesheet.createThemedStyleSheet({code:{fontFamily:c.constants.Fonts.CODE_SEMIBOLD,includeFontPadding:!1,color:$.semanticColors.TEXT_NORMAL}});return c.React.createElement(qr,null,c.React.createElement(on,{title:\"Live Raw Activity\"},ye.lastRawActivity?c.React.createElement(Xr,{style:n.code},JSON.stringify(ye.lastRawActivity,void 0,3)):p.settings.display?c.React.createElement(D,{variant:\"text-md/semibold\"},\"Display activity setting is disabled. You need to actually enable it for the raw activity to show up lmao\"):c.React.createElement(D,{variant:\"text-md/semibold\",onPress:function(){return Je()}},\"No last raw activity yet. Tap text to force update\")),c.React.createElement(on,{title:\"Info\"},c.React.createElement(D,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\"},\"Last raw activity update:\",\" \",ye.lastRawActivityTimestamp?new Date(ye.lastRawActivityTimestamp).toLocaleString(\"en-US\"):\"-\")))};function Qr(e){e.push(\"VendettaCustomPage\",{render:Kr,title:\"Live RawActivity\"})}const Et=\"https://discord.com/api/v9/\",{getToken:xt}=I.findByProps(\"getToken\");async function ea(){return await(await Bt.safeFetch(`${Et}applications?with_team_applications=true`,{headers:{authorization:xt()}})).json()}async function ta(e){return await(await Bt.safeFetch(`${Et}oauth2/applications/${e}/assets`,{cache:\"no-store\",headers:{authorization:xt()}})).json()}const ne={};async function un(e){if(ne[e])return ne[e];ne[e]=\"pending\";let i=(await(await fetch(`${Et}applications/0/external-assets`,{method:\"POST\",headers:{authorization:xt(),\"content-type\":\"application/json\"},body:JSON.stringify({urls:[e]})})).json())[0].external_asset_path;return i.startsWith(\"https://media.discordapp.net\")&&(i=i.split(\"/\").slice(3).join(\"/\")),ne[e]=i,i}const{View:ln,Image:na}=L.General;let dn;const ra=function(){const e=c.NavigationNative.useNavigation(),[i,n]=c.React.useState(\"\"),[r,t]=c.React.useState();dn=function(){return!a&&F.showInputAlert({title:\"Custom App ID\",placeholder:\"123\",confirmText:\"Use\",confirmColor:\"blue\",onConfirm:function(o){if(o.match(/^\\s*$/))return C.showToast(\"App ID cannot be empty\",g.getAssetIDByName(\"Small\"));if(Number.isNaN(Number(o)))return C.showToast(\"Invalid app ID\",g.getAssetIDByName(\"Small\"));at({id:o})},cancelText:\"Cancel\"})},c.React.useEffect(function(){n(\"\")},[]),r||ea().then(t);let a=!1;return r?c.React.createElement(c.ReactNative.FlatList,{ListHeaderComponent:c.React.createElement(L.Search,{style:{marginBottom:10},onChangeText:function(o){return n(o.toLowerCase())}}),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:r.filter(function(o){return o.name.toLowerCase().includes(i.toLowerCase())}),renderItem:function(o){const{item:s}=o;return c.React.createElement(c.ReactNative.TouchableOpacity,{onPress:function(){a||(a=!0,e.goBack(),at?.({id:s.id,name:s.name}))}},c.React.createElement(ln,{style:{marginHorizontal:8,marginBottom:8,flexDirection:\"row\"}},c.React.createElement(na,{source:{uri:s.icon?`https://cdn.discordapp.com/app-icons/${s.icon}/${s.icon}.png?size=64`:G.image},style:{borderRadius:8,resizeMode:\"cover\",aspectRatio:1}}),c.React.createElement(ln,{style:{flexDirection:\"column\",marginLeft:8}},c.React.createElement(D,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\"},s.name),c.React.createElement(D,{variant:\"text-sm/medium\",color:\"TEXT_MUTED\",lineClamp:1},s.description))))}}):c.React.createElement(c.ReactNative.ActivityIndicator,{style:{flex:1}})};function aa(e){e.push(\"VendettaCustomPage\",{render:ra,title:\"Select Application\",headerRight:function(){return c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_custom_color\"),onPress:function(){return dn?.()}})}})}const fn=I.findByProps(\"isTablet\"),{View:pn,Text:ia,Image:sa}=L.General,Tt=c.stylesheet.createThemedStyleSheet({card:{backgroundColor:$.semanticColors.BACKGROUND_SECONDARY,marginHorizontal:4,marginVertical:4,borderRadius:8,flex:1},cardHeader:{backgroundColor:$.semanticColors.BACKGROUND_TERTIARY,borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:8,paddingVertical:8,width:\"100%\"},cardHeaderText:{...Lt[\"text-sm/semibold\"],color:$.semanticColors.TEXT_NORMAL},cardImage:{width:\"100%\",flex:1,borderBottomLeftRadius:8,borderBottomRightRadius:8}}),oa=function(){const e=c.NavigationNative.useNavigation(),[i,n]=c.React.useState(\"\"),[r,t]=c.React.useState();c.React.useEffect(function(){n(\"\")}),r||ta(It).then(t);let a=!1;return r?c.React.createElement(c.ReactNative.FlatList,{ListEmptyComponent:c.React.createElement(L.Search,{style:{marginBottom:10},onChangeText:function(o){return n(o.toLowerCase())}}),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:r.filter(function(o){return o.name.toLowerCase().includes(i)}),numColumns:fn.isTablet?3:2,renderItem:function(o){const{item:s}=o;return c.React.createElement(c.ReactNative.TouchableOpacity,{onPress:function(){a||(a=!0,e.goBack(),Nt?.(s.id))},style:{width:`${fn.isTablet?1/.03:1/.02}%`,aspectRatio:1}},c.React.createElement(pn,{style:Tt.card},c.React.createElement(pn,{style:Tt.cardHeader},c.React.createElement(ia,{style:Tt.cardHeaderText},s.name)),c.React.createElement(sa,{source:{uri:`https://cdn.discordapp.com/app-assets/${It}/${s.id}.png?size=128`}})))}}):c.React.createElement(c.ReactNative.ActivityIndicator,{style:{flex:1}})};function ca(e){e.push(\"VendettaCustomPage\",{render:oa,title:\"Select Asset\"})}function yn(e){const i=Math.abs(Math.floor(e/1e3)),n=Math.floor(i/3600),r=Math.floor(i/60)%60,t=i%60;return`${n?`${n.toString().padStart(2,\"0\")}:`:\"\"}${r.toString().padStart(2,\"0\")}:${t.toString().padStart(2,\"0\")}`}function St(e){const i=Math.floor(e/60),n=e%60;return new Date().setHours(i,n,0,0)}function hn(e){const i=new Date(e);return i.getHours()*60+i.getMinutes()}function gn(e,i){if(e.startsWith(\"spotify:\"))return`https://i.scdn.co/image/${e.slice(8)}`;if(e.startsWith(\"mp:\"))return`https://media.discordapp.net/${e.slice(3)}`;if(!Number.isNaN(Number(e)))return`https://cdn.discordapp.com/app-assets/${i??\"1\"}/${e}.png?size=56`}const mn={online:\"mp:attachments/919655852724604978/1125529509723123712/s_online.png\",idle:\"mp:attachments/919655852724604978/1125529509467279451/s_idle.png\",dnd:\"mp:attachments/919655852724604978/1125529509236572301/s_dnd.png\",offline:\"mp:attachments/919655852724604978/1125529508980731954/s_offline.png\"},_e=I.findByStoreName(\"UserStore\"),K=I.findByStoreName(\"SpotifyStore\"),Ct=I.findByStoreName(\"PresenceStore\");var M;(function(e){e[e.CurrentUser=0]=\"CurrentUser\",e[e.CurrentUserPresence=1]=\"CurrentUserPresence\"})(M||(M={}));const re={presence:{status:void 0,custom:void 0,spotify:null}},At=function(e){return(e??Ct.getActivities(_e.getCurrentUser().id)).find(function(i){return i.type===4})},vn=[{match:\"{user.name}\",description:\"Your username\",types:[M.CurrentUser],replace:function(){return _e.getCurrentUser().username}},{match:\"{user.displayname}\",description:\"Your display name\",types:[M.CurrentUser],replace:function(){return _e.getCurrentUser().globalName}},{match:\"{user.status}\",description:\"Your status\",types:[M.CurrentUserPresence],replace:function(){return At()?.label??\"No Status\"}},{match:\"{user.presence}\",description:\"Your presence (online/dnd/idle/invisible)\",types:[M.CurrentUserPresence],replace:function(){return Ct.getStatus(_e.getCurrentUser().id)}},{match:\"{spotify.track}\",description:\"Your playing Spotify track\",types:[M.CurrentUserPresence],replace:function(){return K.getActivity()?.details??\"No Spotify Track\"}},{match:\"{spotify.track.url}\",description:\"Your playing Spotify track's share link\",types:[M.CurrentUserPresence],replace:function(){const e=K.getActivity()?.sync_id;return e?`https://open.spotify.com/track/${e}`:\"\"}},{match:\"{spotify.artist}\",description:\"Your playing Spotify track's artist(s)\",types:[M.CurrentUserPresence],replace:function(){return(re.presence.spotify=K.getActivity())?.state??\"No Spotify Track\"}},{match:\"{spotify.album}\",description:\"Your playing Spotify track's album\",types:[M.CurrentUserPresence],replace:function(){return(re.presence.spotify=K.getActivity())?.assets?.large_text??\"No Spotify Track\"}}];function ua(e){const i={content:e,types:[]};for(const n of vn){let r;i.content=i.content.replaceAll(n.match,function(){for(const t of n.types)i.types.includes(t)||i.types.push(t);return r??(r=n.replace())})}return i}const _n=[{title:\"Spotify Track Start\",description:\"The timestamp when your playing Spotify track started\",format:\"spotify.track.start\",type:M.CurrentUserPresence,replace:function(){return(re.presence.spotify=K.getActivity())?.timestamps?.start}},{title:\"Spotify Track End\",description:\"The timestamp when your playing Spotify track ends\",format:\"spotify.track.end\",type:M.CurrentUserPresence,replace:function(){return(re.presence.spotify=K.getActivity())?.timestamps?.end}}];function la(e){if(typeof e==\"string\"){const i=_n.find(function(r){return r.format===e}),n=i?.replace();return i?{timestamp:n!==void 0?hn(n):void 0,type:i.type}:{timestamp:0}}else return{timestamp:e}}const bn=[{title:\"User Avatar\",description:\"Your avatar\",format:\"user.avatar\",type:M.CurrentUser,replace:function(){const e=_e.getCurrentUser(),i=Hn({discriminator:e.discriminator,id:e.id,avatar:e.avatar});return ne[i]||un(i).then(ct),`mp:${ne[i]}`}},{title:\"User Presence\",description:\"Your presence (online/idle/dnd/invisible)\",format:\"user.presence\",type:M.CurrentUserPresence,replace:function(){return mn[Ct.getStatus(_e.getCurrentUser().id)]??mn.online}},{title:\"Spotify Album Cover\",description:\"Your playing Spotify track's album cover\",format:\"spotify.album\",type:M.CurrentUserPresence,replace:function(){return K.getActivity()?.assets?.large_image}}];function da(e){const i=bn.find(function(n){return n.format===e});return i?{image:i.replace(),type:i.type}:{image:e}}function fa(e){for(const i of e)i===M.CurrentUser?Sn(\"parsed.currentuser\",\"CURRENT_USER_UPDATE\",ct):i===M.CurrentUserPresence&&Sn(\"parsed.currentuserpresence\",\"SELF_PRESENCE_STORE_UPDATE\",function(n){(re.presence.status!==n.status||JSON.stringify(re.presence.custom)!==JSON.stringify(At(n.activities))||JSON.stringify(re.presence.spotify)!==JSON.stringify(K.getActivity()))&&ct(),re.presence={status:n.status,custom:At(n.activities),spotify:K.getActivity()}})}const{View:pa}=L.General,{FormRow:R,FormRadioRow:ya}=L.Forms,ha=I.findByProps(\"DatePickerModes\"),ga=function(){return c.React.createElement(pa,{style:{marginBottom:16}})},be=c.stylesheet.createThemedStyleSheet({destructiveIcon:{tintColor:$.semanticColors.TEXT_DANGER}}),ke={color:\"TEXT_DANGER\",variant:\"text-md/semibold\"};function ma(e){let{role:i,update:n}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:`${i} Image Variable`,trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),bn.map(function(r){return c.React.createElement(R,{label:r.title,subLabel:r.description,trailing:c.React.createElement(R.Arrow,null),onPress:function(){n(r.format),j()}})})))}let Nt,It;function kn(e){let{appId:i,role:n,image:r,navigation:t,update:a}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:`Edit ${n} Image`,trailing:c.React.createElement(ue,{onPress:j})}),c.React.createElement(R,{label:\"Set Image Variable\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_essentials_sparkle\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return W(ma,{role:n,update:function(o){return a(o)}})}}),c.React.createElement(R,{label:\"Use Custom Image\",subLabel:\"Make sure your image is in a square aspect ratio\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_link\")}),onPress:function(){F.showInputAlert({title:\"Enter the link to your image link\",placeholder:\"can be a discord attachment CDN link\",confirmText:\"Proxy\",confirmColor:\"brand\",onConfirm:async function(o){const s=o.match(ft.constants.HTTP_REGEX_MULTI)?.[0];if(!s)return C.showToast(\"Invalid URL\",g.getAssetIDByName(\"Small\"));C.showToast(\"Proxying image...\",g.getAssetIDByName(\"ic_clock\"));try{a(`mp:${await un(s)}`),C.showToast(\"Proxied image\",g.getAssetIDByName(\"Check\"))}catch(u){console.log(u),C.showToast(\"Failed to proxy image\",g.getAssetIDByName(\"Small\"))}},cancelText:\"Cancel\"})}}),c.React.createElement(R,{label:\"Select RPC Asset\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_media_channel\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){if(!i)return F.showConfirmationAlert({title:\"No App Set\",content:\"An app must be selected in order to use RPC assets\",confirmText:\"Dismiss\",confirmColor:\"grey\",onConfirm:function(){}});It=i,Nt=function(o){Nt=void 0,a(o)},ca(t),j()}}),r&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Image\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){a(void 0),j()}})))}function Rn(e){let{role:i,text:n,url:r,update:t}=e;return c.React.createElement(oe,null,c.React.createElement(ce,{title:`Edit Button ${i}`,trailing:c.React.createElement(ue,{onPress:j})}),c.React.createElement(le,null,c.React.createElement(R,{label:\"Button Text\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return Ue({role:`Button ${i} Text`,current:n,update:function(a){return t({text:a,url:r})}})}}),c.React.createElement(R,{label:\"Button URL\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return Ue({role:`Button ${i} URL`,current:r,update:function(a){return t({text:n,url:a})}})}}),r&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Button URL\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){t({text:n,url:void 0}),j()}}),n&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Button\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){t({text:void 0,url:void 0}),j()}})))}let at;function va(e){let{appId:i,appName:n,navigation:r,update:t}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:\"Edit Application\",trailing:c.React.createElement(ue,{onPress:j})}),c.React.createElement(R,{label:\"Application Name\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return Ue({role:\"Application Name\",current:n,update:function(a){return t({id:i,name:a})}})}}),c.React.createElement(R,{label:\"Select Application\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_robot_24px\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){at=function(a){at=void 0,t({id:a.id??i,name:a.name??n})},aa(r),j()}}),i&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Application\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){t(void 0),j()}})))}function _a(e){let{type:i,update:n}=e;const[r,t]=c.React.useState(i);return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:\"Edit Activity Type\",trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),...Object.values(ae).filter(function(a){return typeof a==\"number\"}).map(function(a){return c.React.createElement(ya,{label:Zn[a],trailing:c.React.createElement(R.Arrow,null),selected:a===r,onPress:function(){n(a),t(a)}})})))}function wn(e){let{role:i,update:n}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:`Set ${i} Time Variable`,trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),_n.map(function(r){return c.React.createElement(R,{label:r.title,subLabel:r.description,trailing:c.React.createElement(R.Arrow,null),onPress:function(){n(r.format),j()}})})),c.React.createElement(ga,null))}function ba(e){let{start:i,end:n,update:r}=e;const t=function(a){let{role:o,onSubmit:s}=a;const u=new Date().setHours(0,0,0,0),l=new Date().setHours(23,59,59,999);Mt(Promise.resolve(ha),\"DatePicker\",{onSubmit:function(d){return s(hn(d._d.getTime()))},title:`Timestamp ${o} Time`,startDate:new Date,minimumDate:new Date(u),maximumDate:new Date(l),requireDateChanged:!1,mode:\"time\"})};return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:\"Edit Timestamp\",trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),c.React.createElement(R,{label:\"Set Start Time Variable\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_essentials_sparkle\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return W(wn,{role:\"Start\",update:function(a){return r({start:a,end:n})}})}}),typeof i!=\"string\"&&c.React.createElement(R,{label:\"Edit Start Time\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return t({role:\"Start\",onSubmit:function(a){return r({start:a,end:n})}})}}),i!==void 0&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Start Time\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){r({start:void 0,end:n}),j()}}),c.React.createElement(R,{label:\"Set End Time Variable\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_essentials_sparkle\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return W(wn,{role:\"End\",update:function(a){return r({start:i,end:a})}})}}),typeof n!=\"string\"&&c.React.createElement(R,{label:\"Edit End Time\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return t({role:\"End\",onSubmit:function(a){return r({start:i,end:a})}})}}),n!==void 0&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove End Time\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){r({start:i,end:void 0}),j()}})))}const it=function(e){let{role:i,button:n,secondaryButton:r,run:t,secondaryRun:a}=e;if(Pn())return t();F.showConfirmationAlert({title:\"Unsaved Changes\",content:[\"You have unsaved changes in \",c.React.createElement(ht.Bold,null,p.activity.profile),`. Are you sure you want to ${i}?`],confirmText:n,confirmColor:\"red\",onConfirm:t,secondaryConfirmText:r,onConfirmSecondary:function(){a?.(),t?.()},cancelText:\"Cancel\"})},Ue=function(e){let{role:i,current:n,update:r}=e;return F.showInputAlert({title:`Enter New ${i}`,initialValue:n,placeholder:`really cool ${i.toLowerCase()}`,confirmText:\"Change\",confirmColor:\"brand\",onConfirm:r,cancelText:\"Cancel\"})},ka=I.findByStoreName(\"UserStore\"),{View:Q,Image:En,Pressable:xn}=L.General,Ra=I.findByName(\"UserActivityContainer\"),ze=c.stylesheet.createThemedStyleSheet({actTypeCont:{flexDirection:\"row\",marginBottom:12,justifyContent:\"space-between\"},card:{borderWidth:1,borderRadius:8,borderColor:$.semanticColors.BACKGROUND_MODIFIER_ACCENT},card2:{alignItems:\"flex-start\",flexDirection:\"row\"},images:{position:\"relative\",marginRight:10},smallImageBg:{borderColor:$.semanticColors.BACKGROUND_PRIMARY,backgroundColor:$.semanticColors.BACKGROUND_PRIMARY,borderWidth:1,borderRadius:18,position:\"absolute\",right:-4,bottom:-4}});let Tn;function wa(e){let{edit:i,act:n}=e;const[r,t]=c.React.useReducer(function(s){return~s},0);Tn=t;const a=c.NavigationNative.useNavigation(),o=function(){t(),dt?.()};return i?c.React.createElement(c.React.Fragment,null,c.React.createElement(Q,{style:ze.actTypeCont},c.React.createElement(D,{variant:\"eyebrow\",color:\"TEXT_NORMAL\",onPress:function(){return W(_a,{type:n.type??ae.Playing,update:function(s){n.type=s,o()}})}},Zn[n.type??ae.Playing],\" ...\")),c.React.createElement(Q,{style:ze.card},c.React.createElement(Q,{style:{padding:16}},c.React.createElement(Q,{style:ze.card2},c.React.createElement(Q,{style:ze.images},c.React.createElement(xn,{onPress:function(){return W(kn,{appId:n.app.id,role:\"Large\",image:n.assets.largeImg,navigation:a,update:function(s){n.assets.largeImg=s,o()}})}},c.React.createElement(En,{source:{uri:gn(n.assets.largeImg??\".\",n.app.id)??G.image},style:{borderRadius:3,width:56,height:56}})),c.React.createElement(Q,{style:ze.smallImageBg},c.React.createElement(xn,{onPress:function(){return W(kn,{appId:n.app.id,role:\"Small\",image:n.assets.smallImg,navigation:a,update:function(s){n.assets.smallImg=s,o()}})}},c.React.createElement(En,{source:{uri:gn(n.assets.smallImg??\".\",n.app.id)??G.image},style:{borderRadius:14,width:28,height:28}})))),c.React.createElement(Q,{style:{flex:1}},c.React.createElement(D,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\",onPress:function(){return W(va,{appId:n.app.id,appName:n.app.name,navigation:a,update:function(s){s?.id!==n.app.id&&(Number.isNaN(Number(n.assets.smallImg))||delete n.assets.smallImg,Number.isNaN(Number(n.assets.largeImg))||delete n.assets.largeImg),n.app.id=s?.id,n.app.name=s?.name,o()}})}},n.app.name??G.appName),c.React.createElement(D,{variant:\"text-sm/normal\",color:\"TEXT_NORMAL\",onPress:function(){return Ue({role:\"Details\",current:n.details,update:function(s){n.details=s,o()}})}},n.details??G.details),c.React.createElement(D,{variant:\"text-sm/normal\",color:\"TEXT_NORMAL\",onPress:function(){return Ue({role:\"State\",current:n.state,update:function(s){n.state=s,o()}})}},n.state??G.state),c.React.createElement(D,{variant:\"text-sm/normal\",color:\"TEXT_NORMAL\",onPress:function(){return W(ba,{start:n.timestamps.start,end:n.timestamps.end,update:function(s){n.timestamps.start=s.start,n.timestamps.end=s.end,o()}})},liveUpdate:!0,getChildren:function(){return typeof n.timestamps.end==\"string\"?`{${n.timestamps.end}}`:typeof n.timestamps.end==\"number\"?`${yn(St(n.timestamps.end)-Date.now())} left`:typeof n.timestamps.start==\"string\"?`{${n.timestamps.start}}`:typeof n.timestamps.start==\"number\"?`${yn(Date.now()-St(n.timestamps.start))} elapsed`:G.timestamp}}))),c.React.createElement(Q,{style:{marginTop:16}},c.React.createElement(L.Button,{text:n.buttons[0]?.text??G.button1,style:{backgroundColor:\"grey\"},size:\"small\",onPress:function(){return W(Rn,{role:\"1\",text:n.buttons[0]?.text,url:n.buttons[0]?.url,update:function(s){let{text:u,url:l}=s;!u&&!l?n.buttons[0]=void 0:n.buttons[0]={text:u,url:l},o()}})}})),c.React.createElement(Q,{style:{marginTop:10}},c.React.createElement(L.Button,{text:n.buttons[1]?.text??G.button2,style:{backgroundColor:\"grey\"},size:\"small\",onPress:function(){return W(Rn,{role:\"2\",text:n.buttons[1]?.text,url:n.buttons[1]?.url,update:function(s){let{text:u,url:l}=s;!u&&!l?n.buttons[1]=void 0:n.buttons[1]={text:u,url:l},o()}})}}))))):c.React.createElement(Ra,{user:ka.getCurrentUser(),activity:Nn(n).activity})}const st={};function Ea(e,i,n,r){if(st[e])return;const t={default:r,timeout:-1};st[e]=t;const a=function(){const o=i(new Date);t.timeout=setTimeout(function(){n(),a()},o-Date.now())};a()}const ot={};function Sn(e,i,n,r){ot[e]||(c.FluxDispatcher.subscribe(i,n),ot[e]={default:r,event:i,handler:n})}function Cn(e){for(const[i,n]of Object.entries(st))(e||!n.default)&&(clearTimeout(n.timeout),delete st[i]);for(const[i,n]of Object.entries(ot))(e||!n.default)&&(c.FluxDispatcher.unsubscribe(n.event,n.handler),delete ot[i])}function xa(){Ea(\"auto_fix_timestamps\",function(e){return e.setHours(24,0,0,0)},ct,!0)}function ct(){Tn?.(),Je()}var ae;(function(e){e[e.Playing=0]=\"Playing\",e[e.Listening=2]=\"Listening\",e[e.Watching=3]=\"Watching\",e[e.Competing=5]=\"Competing\"})(ae||(ae={}));const An=O.object({app:O.object({name:O.string().optional(),id:O.string().optional()}),state:O.string().optional(),details:O.string().optional(),timestamps:O.object({start:O.string().or(O.number()).optional(),end:O.string().or(O.number()).optional()}),assets:O.object({largeImg:O.string().optional(),smallImg:O.string().optional()}),buttons:O.array(O.object({text:O.string(),url:O.string().optional()})),type:O.nativeEnum(ae)});var Pt;(function(e){e[e.Instance=1]=\"Instance\",e[e.Join=2]=\"Join\",e[e.Spectate=4]=\"Spectate\",e[e.JoinRequest=8]=\"JoinRequest\",e[e.Sync=16]=\"Sync\",e[e.Play=32]=\"Play\",e[e.PartyPrivacyFriends=64]=\"PartyPrivacyFriends\",e[e.PartyPrivacyVoiceChannel=128]=\"PartyPrivacyVoiceChannel\",e[e.Embedded=256]=\"Embedded\"})(Pt||(Pt={}));function ut(){return{timestamps:{},assets:{},buttons:[],app:{}}}function Nn(e){const i=[],n={str:function(t){const a=ua(t);for(const o of a.types)i.includes(o)||i.push(o);return a.content},tim:function(t){const a=la(t);return a.type&&!i.includes(a.type)&&i.push(a.type),a.timestamp!==void 0?St(a.timestamp):void 0},img:function(t){const a=da(t);return a.type&&!i.includes(a.type)&&i.push(a.type),a.image}},r={name:n.str(e.app.name??G.appName),application_id:e.app.id??\"0\",type:e.type??ae.Playing,flags:Pt.Instance,state:e.state&&n.str(e.state),details:e.details&&n.str(e.details),timestamps:{start:e.timestamps.start!==void 0?n.tim(e.timestamps.start):void 0,end:e.timestamps.end!==void 0?n.tim(e.timestamps.end):void 0},assets:{large_image:e.assets.largeImg&&n.img(e.assets.largeImg),small_image:e.assets.smallImg&&n.img(e.assets.smallImg)}};return r.assets.large_image&&r.type===ae.Playing&&(r.assets.large_text=\"CRPC@VD\"),e.buttons[0]&&(r.metadata={button_urls:e.buttons.slice(0,2).filter(function(t){return!!t.text}).map(function(t){return t.url?n.str(t.url):null})},r.buttons=e.buttons.slice(0,2).filter(function(t){return!!t.text}).map(function(t){return n.str(t.text)})),ye.lastRawActivity=r,ye.lastRawActivityTimestamp=Date.now(),cn?.(),{activity:r,types:i}}async function Dt(e){let i={};if(Cn(),e){const n=Nn(e);i=n.activity,fa(n.types)}c.FluxDispatcher.dispatch({type:\"LOCAL_ACTIVITY_UPDATE\",activity:i,socketId:\"CustomRPC@Vendetta\"})}function In(){return p.profiles?.[p.activity?.profile]??p.activity?.editing??ut()}function Je(){const e=In();p.settings?.display?Dt(e):Dt()}function Pn(){const e=In();return JSON.stringify(e)===JSON.stringify(p.activity.editing)}//! for some reason the compiler breaks here and doesn't recognize ActivityType\nconst Ta={\"Vendetta Advertisement\":{state:\"Join Now\",details:'\"The best Discord client for mobile\"',app:{name:\"Vendetta\"},timestamps:{},assets:{largeImg:\"mp:external/t88vNcbCl2anXnBX4gmLVep17K_yqL4L2pvzwPMGtjs/%3Fsize%3D512/https/cdn.discordapp.com/icons/1015931589865246730/5b7f29e9c670fbcbf476b4d88fbd081f.png\"},type:3,buttons:[{text:\"Join Vendetta\",url:\"https://discord.gg/vendetta-mod\"},{text:\"Install Vendetta\",url:\"https://github.com/vendetta-mod/Vendetta#installing\"}]},\"Scuffed Spotify Activity\":{timestamps:{start:\"spotify.track.start\",end:\"spotify.track.end\"},assets:{smallImg:\"user.avatar\",largeImg:\"spotify.album\"},buttons:[{text:\"Listen Along\",url:\"{spotify.track.url}\"}],app:{name:\"{spotify.track}\"},type:2,details:\"by {spotify.artist}\",state:\"on {spotify.album}\"},\"My Profile\":{timestamps:{start:0},assets:{largeImg:\"user.avatar\",smallImg:\"user.presence\"},buttons:[],app:{name:\"{user.displayname}\"},type:3,details:\"{user.name}\",state:\"{user.status}\"}},{View:Sa}=L.General,{FormRadioRow:Ca,FormRow:Aa}=L.Forms,{showSimpleActionSheet:Na}=I.findByProps(\"showSimpleActionSheet\"),Ia=I.findByProps(\"openLazy\",\"hideActionSheet\"),lt={import:void 0,add:void 0},Pa=function(){const e=c.NavigationNative.useNavigation(),[i,n]=c.React.useReducer(function(o){return~o},0),[r,t]=c.React.useState(\"\");c.React.useEffect(function(){t(\"\")},[]),lt.add=function(){return F.showInputAlert({title:\"Enter new profile name\",placeholder:\"Super Awesome RPC\",confirmText:\"Add\",confirmColor:\"brand\",onConfirm:function(o){if(o.match(/^\\s*$/))return C.showToast(\"Profile name cannot be empty\",g.getAssetIDByName(\"Small\"));if(o=o.trim(),p.profiles[o])return C.showToast(\"A profile with that name already exists\",g.getAssetIDByName(\"Small\"));p.profiles[o]=JSON.parse(JSON.stringify(p.activity.editing)),p.activity.profile=o,n(),C.showToast(\"Created profile\",g.getAssetIDByName(\"Check\"))},cancelText:\"Cancel\"})},lt.import=async function(){let o;try{o=JSON.parse(await c.clipboard.getString())}catch{return C.showToast(\"Failed to parse JSON\")}const s=An.safeParse(o);if(!s.success)return C.showToast(\"Invalid profile data\",g.getAssetIDByName(\"Small\"));let u=0,l=\"Imported Profile\";for(;p.profiles[l];)u++,l=`Imported Profile (${u})`;p.profiles[l]=s.data,p.activity.profile=l,n(),C.showToast(\"Imported profile\",g.getAssetIDByName(\"Check\"))};let a=!1;return c.React.createElement(c.ReactNative.FlatList,{ListHeaderComponent:c.React.createElement(L.Search,{style:{marginBottom:10},onChangeText:function(o){return t(o.toLowerCase())}}),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:Object.keys(p.profiles).filter(function(o){return o.toLowerCase().includes(r)}),renderItem:function(o){let{item:s}=o;return c.React.createElement(Ca,{label:s,onLongPress:function(){return Na({key:\"CardOverflow\",header:{title:s,onClose:function(){return Ia.hideActionSheet()}},options:[{label:\"Copy Profile\",icon:g.getAssetIDByName(\"copy\"),onPress:function(){c.clipboard.setString(JSON.stringify(p.profiles[s],void 0,3)),C.showToast(\"Copied\",g.getAssetIDByName(\"toast_copy_link\"))}},{label:\"Rename Profile\",icon:g.getAssetIDByName(\"ic_message_edit\"),onPress:function(){return F.showInputAlert({title:\"Enter new profile name\",placeholder:\"Super Awesome RPC 2.0\",initialValue:s,confirmText:\"Rename\",confirmColor:\"brand\",onConfirm:function(u){if(u.match(/^\\s*$/))return C.showToast(\"Profile name cannot be empty\",g.getAssetIDByName(\"Small\"));if(u=u.trim(),p.profiles[u])return C.showToast(\"A profile with that name already exists\",g.getAssetIDByName(\"Small\"));p.profiles[u]=p.profiles[s],p.activity.profile===s&&(p.activity.profile=u),delete p.profiles[s],n(),C.showToast(\"Renamed profile\",g.getAssetIDByName(\"Check\"))},cancelText:\"Cancel\"})}},{label:\"Delete Profile\",icon:g.getAssetIDByName(\"trash\"),isDestructive:!0,onPress:function(){return F.showConfirmationAlert({title:\"Delete Profile\",content:\"Are you sure you want to delete this profile? This cannot be undone.\",confirmText:\"Delete\",confirmColor:\"red\",onConfirm:function(){p.activity.profile===s&&(delete p.activity.profile,p.activity.editing=ut()),delete p.profiles[s],n(),dt?.(),C.showToast(\"Deleted\",g.getAssetIDByName(\"Check\"))},cancelText:\"Cancel\"})}}]})},onPress:function(){if(!a){if(p.activity.profile===s)return C.showToast(`${s} is already loaded`,g.getAssetIDByName(\"Small\"));it({role:\"discard your changes\",button:\"Discard\",run:function(){p.activity.editing=JSON.parse(JSON.stringify(p.profiles[s])),p.activity.profile=s,a=!0,e.goBack(),dt?.(),C.showToast(\"Loaded\",g.getAssetIDByName(\"Check\"))},secondaryButton:\"Save profile\",secondaryRun:function(){p.profiles[p.activity.profile]=JSON.parse(JSON.stringify(p.activity.editing))}})}},trailing:c.React.createElement(Aa.Arrow,null),selected:p.activity.profile===s})}})};function Da(e){e.push(\"VendettaCustomPage\",{render:Pa,title:\"Profiles\",headerRight:function(){return c.React.createElement(Sa,{style:{flexDirection:\"row-reverse\"}},c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_add_24px\"),onPress:function(){return lt.add?.()}}),c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_file_upload_24px\"),onPress:function(){return lt.import?.()}}))}})}const{ScrollView:Oa,View:Ot,Pressable:Za}=L.General,{FormSwitchRow:Dn,FormIcon:On,FormRow:Z}=L.Forms,G={image:\"https://discord.com/assets/cb1043c312ec65507573c06c37f6ee63.gif\",appName:\"Enter App Name...\",details:\"Enter Details...\",state:\"Enter State...\",timestamp:\"Enter Timestamp...\",button1:\"Edit Button 1...\",button2:\"Edit Button 2...\"},Zn={0:\"Playing\",2:\"Listening to\",3:\"Watching\",5:\"Competing in\"},Ba=c.stylesheet.createThemedStyleSheet({androidRipple:{color:$.semanticColors.ANDROID_RIPPLE,cornerRadius:8}});let dt;function $a(){var e,i,n;const r=c.NavigationNative.useNavigation(),[t,a]=c.React.useReducer(function(f){return~f},0);if(dt=a,(e=p).settings??(e.settings={edit:!1,display:!1,debug:{enabled:!1,visible:!1,boykisserDead:void 0}}),(i=p).activity??(i.activity={editing:ut()}),(n=p).profiles??(n.profiles=Ta),$n.useProxy(p),c.React.useEffect(function(){p.settings.debug.boykisserDead!==void 0&&Yn(ft.plugin,[{changes:[\"+ added boykisser back\",\"+ you can now kill boykisser (don't)\",\"+ fixed typo\",\"+ added a string variables 'Help' button\"]},{changes:[\"+ initial update guhhh\"]}])},[p.settings.debug.boykisserDead===void 0]),c.React.useEffect(function(){p.settings.debug.boykisserDead!==void 0&&p.settings.display&&Je()},[JSON.stringify(p.activity.editing),p.settings.display,p.settings.debug.boykisserDead===void 0]),p.settings.debug.boykisserDead===void 0)return yt.getItem(\"CRPC_boykisser\").then(function(f){p.settings.debug.boykisserDead=f===\"true\",a()}),c.React.createElement(c.ReactNative.ActivityIndicator,{style:{flex:1}});const o=r.addListener(\"focus\",function(){o(),r.setOptions({headerRight:function(){return c.React.createElement(Ot,{style:{flexDirection:\"row-reverse\"}},c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_report_message\"),onPress:function(){return Qn(\"customrpc\")}}),c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_essentials_sparkle\"),onPress:function(){return F.showConfirmationAlert({title:\"String Variables\",content:`String variables can be used in any text component\nHere's the entire list:\n\n${vn.map(function(f){return`**\\`${f.match}\\`**\n \\u2014 ${f.description}`}).join(`\n`)}`,confirmText:\"Dismiss\",confirmColor:\"brand\",onConfirm:function(){}})}}))}})});let s=0,u,l=-1,d;return c.React.createElement(c.React.Fragment,null,c.React.createElement(Wn,{style:[{backgroundColor:\"#f11\",position:\"absolute\",width:\"100%\",height:\"100%\",zIndex:2}],fade:\"out\",duration:1e3,trigger:p.settings.debug.boykisserDead,setDisplay:!0,animateOnInit:!1}),c.React.createElement(Oa,{style:{zIndex:1}},c.React.createElement(He,{title:\"Preview\",onTitlePress:function(){if(p.settings.debug.enabled)p.settings.debug.visible=!p.settings.debug.visible,C.showToast(p.settings.debug.boykisserDead?`debug tab ${p.settings.debug.visible?\"on\":\"off\"}`:`Debug tab ${p.settings.debug.visible?\"visible\":\"hidden\"}`);else{if(u&&clearTimeout(u),u=setTimeout(function(){s=0},500),s++,s<2)return;if(s<7){const f=7-s;return C.showToast(p.settings.debug.boykisserDead?`tap ${f} more time${f!==1?\"s\":\"\"}`:`${f} more taps`)}else C.showToast(p.settings.debug.boykisserDead?\"the sin of murdering boykisser continues to haunt you\":\"Behold! You can now debug!\"),p.settings.debug.visible=!0,p.settings.debug.enabled=!0,a()}},icon:g.getAssetIDByName(\"ic_eye\"),padding:p.settings.edit},c.React.createElement(wa,{edit:p.settings.edit,act:p.activity.editing})),c.React.createElement(He,{title:\"Settings\",icon:g.getAssetIDByName(\"ic_cog_24px\")},c.React.createElement(Dn,{label:\"Edit Mode\",subLabel:\"Be able to edit your activity\",leading:c.React.createElement(On,{source:g.getAssetIDByName(\"ic_badge_staff\")}),onValueChange:function(){return p.settings.edit=!p.settings.edit},value:p.settings.edit}),c.React.createElement(Dn,{label:\"Display Activity\",subLabel:\"Show off your super awesome poggers activity to the world\",leading:c.React.createElement(On,{source:g.getAssetIDByName(\"ic_show_password\")}),onValueChange:function(){return p.settings.display=!p.settings.display},value:p.settings.display})),c.React.createElement(He,{title:\"Data\",icon:g.getAssetIDByName(\"ic_feedback\")},c.React.createElement(Z,{label:\"Copy as JSON\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"copy\")}),onPress:function(){c.clipboard.setString(JSON.stringify(p.activity.editing,void 0,3)),C.showToast(\"Copied\",g.getAssetIDByName(\"toast_copy_link\"))}}),c.React.createElement(Z,{label:\"Load from Clipboard\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_download_24px\")}),onPress:function(){return it({role:\"overwrite the activity data\",button:\"Overwrite\",run:async function(){let f;try{f=JSON.parse(await c.clipboard.getString())}catch{return C.showToast(\"Failed to parse JSON\",g.getAssetIDByName(\"Small\"))}const h=An.safeParse(f);if(!h.success)return C.showToast(\"Invalid activity data\",g.getAssetIDByName(\"Small\"));p.activity.editing=h.data,delete p.activity.profile,a(),C.showToast(\"Loaded\",g.getAssetIDByName(\"Check\"))}})}}),c.React.createElement(Ut,{addPadding:!0}),p.activity.profile&&c.React.createElement(Z,{label:`Save Profile${Pn()?\"\":\" \\u{1F534}\"}`,leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){p.profiles[p.activity.profile]=JSON.parse(JSON.stringify(p.activity.editing)),C.showToast(\"Saved\",g.getAssetIDByName(\"Check\")),a()}}),p.activity.profile&&c.React.createElement(Z,{label:\"Revert Profile\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return it({role:\"revert\",button:\"Revert\",run:function(){p.activity.editing=JSON.parse(JSON.stringify(p.profiles[p.activity.profile])),C.showToast(\"Reverted\",g.getAssetIDByName(\"Check\")),a()}})}}),p.activity.profile&&c.React.createElement(Z,{label:\"Close Profile\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return it({role:\"discard your changes\",button:\"Discard\",run:function(){p.activity.editing=ut(),delete p.activity.profile,C.showToast(\"Closed\",g.getAssetIDByName(\"Check\")),a()},secondaryButton:\"Save profile\",secondaryRun:function(){p.profiles[p.activity.profile]=JSON.parse(JSON.stringify(p.activity.editing))}})}}),c.React.createElement(Z,{label:\"Browse Profiles\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),trailing:c.React.createElement(Z.Arrow,null),onPress:function(){return Da(r)}})),p.settings.debug.visible&&c.React.createElement(He,{title:\"Debug\",icon:g.getAssetIDByName(\"ic_progress_wrench_24px\")},c.React.createElement(Z,{label:\"Live RawActivity View\",trailing:c.React.createElement(Z.Arrow,null),leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_badge_staff\")}),onPress:function(){return Qr(r)}}),c.React.createElement(Z,{label:\"Flush MP Cache\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_badge_staff\")}),onPress:function(){let f=0;for(const b of Object.keys(ne))f++,delete ne[b];const h=\":3,>:3,:D,>:D,:P,>:P\".split(\",\");C.showToast(`flushed cache ${h[Math.floor(Math.random()*h.length)]}`),f>0&&Je()}}),!p.settings.debug.boykisserDead&&c.React.createElement(c.React.Fragment,null,c.React.createElement(Ut,{addPadding:!0}),c.React.createElement(Ot,{style:{paddingHorizontal:16,paddingBottom:16}},c.React.createElement(Za,{android_ripple:Ba.androidRipple,disabled:!1,accessibilityRole:\"button\",accessibilityLabel:\"boykisser\",accessibilityHint:\"tap to boykiss\",onPress:function(){const f=\"nya,mwah,uwu,nya~,guh,blehhh >:P\".split(\",\");C.showToast(f[Math.floor(Math.random()*f.length)])},delayLongPress:500,onLongPress:function(){if(p.settings.debug.boykisserDead)return C.showToast(\"fuck you\");d&&clearTimeout(d),d=setTimeout(function(){l=-1},3e3),l++;const f=[\"tapping and holding on boykisser will kill him. are you sure?\",\"i am serious, are you sure?\",\"are you TOTALLY sure you want to kill him?\",\"this cannot be undone\",\"please, have mercy on him\",\"this is your last warning, he will be forever killed\",\"you don't want to do this\",\"please, i beg you\"];f[l]?C.showToast(f[l]):(p.settings.debug.boykisserDead=!0,yt.setItem(\"CRPC_boykisser\",\"true\"),a(),C.showToast(\"you have MURDERED boykisser. fuck you\"))}},c.React.createElement(c.ReactNative.Image,{source:{uri:\"https://cdn.discordapp.com/attachments/919655852724604978/1126175249424191548/723.gif\"},style:{borderRadius:8,width:\"100%\",aspectRatio:1}}))))),c.React.createElement(Ot,{style:{marginBottom:20}})))}const p=Bn.storage,ye={lastRawActivity:void 0,lastRawActivityTimestamp:void 0};var La={onLoad:async function(){p.settings.debug&&(p.settings.debug.boykisserDead=await yt.getItem(\"CRPC_boykisser\")===\"true\"),Je(),xa()},onUnload:function(){Dt(),Cn(!0)},settings:$a};return we.debug=ye,we.default=La,we.vstorage=p,Object.defineProperty(we,\"__esModule\",{value:!0}),we})({},vendetta.plugin,vendetta,vendetta.metro,vendetta.metro.common,vendetta.ui,vendetta.ui.assets,vendetta.ui.components,vendetta.ui.toasts,vendetta.utils,vendetta.storage,vendetta.ui.alerts,vendetta.debug);\n"},"https://vd-plugins.github.io/proxy/vendetta.nexpid.xyz/song-spotlight/":{"id":"https://vd-plugins.github.io/proxy/vendetta.nexpid.xyz/song-spotlight/","manifest":{"name":"SongSpotlight","description":"Makes it so you can pin songs to your profile","authors":[{"name":"nexpid","id":"853550207039832084"}],"main":"index.js","vendetta":{"icon":"ic_music","original":"vendetta.nexpid.xyz/song-spotlight/"},"hash":"06a70e1ee1a488ed015cfea01879a4c6e614dd4d53c1da881af8b364911a810f"},"enabled":true,"update":true,"js":"(function(k,be,V,Se,l,e,b,me,p,M,C,xe,Nt,ae){\"use strict\";const Ae=l.findByStoreName(\"ThemeStore\"),Pe=l.findByProps(\"colors\",\"meta\");l.findByProps(\"triggerHaptic\");const H=l.findByProps(\"TextStyleSheet\").TextStyleSheet,{View:L,Text:re,Pressable:Te}=M.General;l.findByProps(\"TableRow\");const Ie=l.findByProps(\"ActionSheet\")?.ActionSheet??l.find(function(t){return t.render?.name===\"ActionSheet\"}),Be=l.findByProps(\"openLazy\",\"hideActionSheet\"),{openLazy:Ne,hideActionSheet:O}=Be,{ActionSheetTitleHeader:ke,ActionSheetCloseButton:De,ActionSheetContentContainer:_e}=l.findByProps(\"ActionSheetTitleHeader\",\"ActionSheetCloseButton\",\"ActionSheetContentContainer\");l.findByProps(\"ActionSheetRow\")?.ActionSheetRow,l.findByName(\"Navigator\")??l.findByProps(\"Navigator\")?.Navigator,l.findByProps(\"getRenderCloseButton\")?.getRenderCloseButton??l.findByProps(\"getHeaderCloseButton\")?.getHeaderCloseButton,l.findByProps(\"popModal\",\"pushModal\");const ie=l.findByProps(\"useSearchControls\"),G=l.findByProps(\"useSettingSearchQuery\"),Me=l.findByName(\"SettingSearchBar\"),{SvgXml:oe}=l.findByProps(\"SvgXml\");l.findByProps(\"useInMainTabsExperiment\",\"isInMainTabsExperiment\");const Le=l.find(function(t){return t?.WebView&&!t.default}).WebView;l.findByProps(\"Button\",\"SegmentedControl\");function Oe(t){return Pe.meta.resolveSemanticColor(Ae.theme,t)}function X(t,n){try{Ne(new Promise(function(r){return r({default:t})}),\"ActionSheet\",n)}catch(r){xe.logger.error(r.stack),C.showToast(\"Got error when opening ActionSheet! Please check debug logs\",p.getAssetIDByName(\"Smal\"))}}Object.assign(function(t){let{searchContext:n,controls:r}=t;return e.React.createElement(e.ReactNative.ScrollView,{scrollEnabled:!1},e.React.createElement(ie.default,{searchContext:n,controls:r},e.React.createElement(Me,null)))},{useAdvancedSearch:function(t){const n=G.useSettingSearchQuery(),r=ie.useSearchControls(t,!1,function(){});return e.React.useEffect(function(){return function(){G.setSettingSearchQuery(\"\"),G.setIsSettingSearchActive(!1)}},[]),[n,r]}}),window.nativeModuleProxy.DCDFileManager??window.nativeModuleProxy.RTNFileManager,window.nativeModuleProxy.BundleUpdaterManager,window.nativeModuleProxy.MMKVManager,window.nativeModuleProxy.DCDSoundManager;function $e(t){let{title:n,onPress:r,icon:a}=t;const o=e.stylesheet.createThemedStyleSheet({androidRipple:{color:b.semanticColors.ANDROID_RIPPLE},icon:{height:18,tintColor:b.semanticColors.HEADER_SECONDARY,opacity:.5}}),s=r?Te:L;return e.React.createElement(s,{android_ripple:o.androidRipple,disabled:!1,accessibilityRole:\"button\",onPress:r,style:{marginBottom:8,flexDirection:\"row\",justifyContent:\"flex-start\",alignItems:\"center\"}},a&&e.React.createElement(L,{style:{marginRight:4}},e.React.createElement(e.ReactNative.Image,{style:o.icon,source:a,resizeMode:\"contain\"})),e.React.createElement(S,{variant:\"text-sm/semibold\",color:\"HEADER_SECONDARY\"},n))}function ce(t){let{title:n,onTitlePress:r,icon:a,children:o,padding:s}=t;const u=e.stylesheet.createThemedStyleSheet({main:{backgroundColor:b.semanticColors.CARD_PRIMARY_BG,borderRadius:16,overflow:\"hidden\",flex:1}});return e.React.createElement(L,{style:{marginHorizontal:16,marginTop:16}},e.React.createElement($e,{title:n,onPress:r,icon:a}),e.React.createElement(L,{style:u.main},s?e.React.createElement(L,{style:{paddingHorizontal:16,paddingVertical:16}},o):o))}var se;(function(t){function n(a){let{children:o,onPress:s}=a;return e.React.createElement(S,{variant:\"text-md/bold\",onPress:s},o)}t.Bold=n;function r(a){let{children:o,onPress:s}=a;return e.React.createElement(re,{style:{textDecorationLine:\"underline\"},onPress:s},o)}t.Underline=r})(se||(se={}));function S(t){let{variant:n,lineClamp:r,color:a,align:o,style:s,onPress:u,getChildren:f,children:i,liveUpdate:g}=t;const[m,x]=e.React.useReducer(function(N){return~N},0);return e.React.useEffect(function(){if(!g)return;const N=new Date().setMilliseconds(1e3);let E;const c=setTimeout(function(){x(),E=setInterval(x,1e3)},N-Date.now());return function(){clearTimeout(c),clearInterval(E)}},[]),e.React.createElement(re,{style:[n?H[n]:{},a?{color:Oe(b.semanticColors[a])}:{},o?{textAlign:o}:{},s??{}],numberOfLines:r,onPress:u},f?.()??i)}const le=\"https://songspotlight.nexpid.xyz/\";var P={get api(){return y.host?y.host.endsWith(\"/\")?y.host:`${y.host}/`:le},oauth2:{clientId:\"1157745434140344321\",get redirectURL(){return`${y.host?y.host.endsWith(\"/\")?y.host:`${y.host}/`:le}api/oauth2-response`}}};function Ue(t){if(t===void 0)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}function je(t,n){if(!(t instanceof n))throw new TypeError(\"Cannot call a class as a function\")}function z(t,n,r){return ue()?z=Reflect.construct:z=function(a,o,s){var u=[null];u.push.apply(u,o);var f=Function.bind.apply(a,u),i=new f;return s&&U(i,s.prototype),i},z.apply(null,arguments)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},$(t)}function Ve(t,n){if(typeof n!=\"function\"&&n!==null)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&U(t,n)}function ze(t){return Function.toString.call(t).indexOf(\"[native code]\")!==-1}function Fe(t,n){return n&&(He(n)===\"object\"||typeof n==\"function\")?n:Ue(t)}function U(t,n){return U=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},U(t,n)}function He(t){\"@swc/helpers - typeof\";return t&&typeof Symbol<\"u\"&&t.constructor===Symbol?\"symbol\":typeof t}function W(t){var n=typeof Map==\"function\"?new Map:void 0;return W=function(r){if(r===null||!ze(r))return r;if(typeof r!=\"function\")throw new TypeError(\"Super expression must either be null or a function\");if(typeof n<\"u\"){if(n.has(r))return n.get(r);n.set(r,a)}function a(){return z(r,arguments,$(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),U(a,r)},W(t)}function ue(){if(typeof Reflect>\"u\"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==\"function\")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ge(t){var n=ue();return function(){var r=$(t),a;if(n){var o=$(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return Fe(this,a)}}const de=l.findByStoreName(\"UserStore\");let D=function(t){Ve(r,t);var n=Ge(r);function r(a){je(this,r);var o;return o=n.call(this,`${a.status}: ${a.message}${a.error?` (${a.error})`:\"\"}`),o.name=o.constructor.name,o}return r}(W(Error));function T(){return y.auth?.[de.getCurrentUser()?.id]}async function J(){var t;const n=new Error(\"Unauthorized, try logging out and back in again\");let r=T();if(!r)throw n;if(Date.now()>=r.expiresAt){const a=await fetch(`${P.api}api/refresh-access-token?refresh_token=${encodeURIComponent(r.refreshToken)}`);if(a.status!==200)throw new D(await a.json());r=await a.json(),(t=y).auth??(t.auth={}),y.auth[de.getCurrentUser().id]=r}return r.accessToken}async function Xe(t){const n=await fetch(`${P.api}api/get-access-token?code=${encodeURIComponent(t)}`);if(n.status===200)return await n.json();throw new D(await n.json())}async function We(t){const n=new URLSearchParams;n.append(\"id\",t);const r=await fetch(`${P.api}api/get-profile-data?${n.toString()}`);if(r.status===200)return await r.json();throw new D(await r.json())}async function Je(){if(!T())return;const t=await fetch(`${P.api}api/get-data`,{headers:{authorization:await J()}});if(t.status===200)return await t.json();throw new D(await t.json())}async function Ze(t){if(!T())return;const n=await fetch(`${P.api}api/sync-data`,{method:\"POST\",headers:{authorization:await J(),\"content-type\":\"application/json\"},body:JSON.stringify(t)});if(n.status===200)return await n.json();throw new D(await n.json())}async function Ye(){if(!T())return;const t=await fetch(`${P.api}api/delete-data`,{method:\"DELETE\",headers:{authorization:await J()}});if(t.status===200)return await t.json();throw new D(await t.json())}let fe=0;function Qe(t){clearTimeout(fe),fe=setTimeout(t,1500)}let pe;function Z(){const t=pe?.slice();pe=JSON.stringify(v.data),t&&t!==JSON.stringify(v.data)&&Qe(function(){return Ze(v.data.songs)})}const{pushModal:qe,popModal:Ke}=l.findByProps(\"pushModal\",\"popModal\"),et=l.findByName(\"OAuth2AuthorizeModal\"),tt=l.findByStoreName(\"UserStore\");function nt(){qe({key:\"oauth2-authorize\",modal:{key:\"oauth2-authorize\",modal:et,animation:\"slide-up\",shouldPersistUnderModals:!1,props:{clientId:P.oauth2.clientId,redirectUri:P.oauth2.redirectURL,scopes:[\"identify\"],responseType:\"code\",permissions:0n,cancelCompletesFlow:!1,callback:async function(t){var n;let{location:r}=t;try{const a=new URL(r).searchParams.get(\"code\"),o=await Xe(a);(n=y).auth??(n.auth={}),y.auth[tt.getCurrentUser().id]=o,te(),C.showToast(\"Successfully authenticated\",p.getAssetIDByName(\"Check\"))}catch(a){C.showToast(String(a),p.getAssetIDByName(\"Small\"))}},dismissOAuthModal:function(){return Ke(\"oauth2-authorize\")}},closable:!0}})}const Y=new Map,Q=async function(t,n,r,a){const o=`${t}${n}${r}`;if(Y.has(o))return Y.get(o);if(t===\"spotify\"){const s=await(await fetch(`https://open.spotify.com/embed/${n}/${r}`,{signal:a})).text(),u=JSON.parse(`{\"props\"${s.split('{\"props\"')[1].split(\"<\\/script>\")[0]}`);return Y.set(o,u),u}else return!1};async function at(t,n,r,a){if(t===\"spotify\"){const o=(await Q(t,n,r,a))?.props?.pageProps?.state?.data?.entity;return o?.name&&o?.coverArt?o:!1}else return!1}async function rt(t,n,r,a){return t===\"spotify\"?(await Q(t,n,r,a))?.props?.pageProps?.state?.data?.entity?.name??!1:!1}async function it(t,n,r,a){return t===\"spotify\"?(await Q(t,n,r,a)).page?.props?.status!==404:!1}const he=function(t,n,r){return t===\"spotify\"?`https://open.spotify.com/${n}/${r}`:void 0};l.findByStoreName(\"ThemeStore\");async function ot(t){await e.ReactNative.Linking.canOpenURL(t)?e.url.openDeeplink(t):await e.ReactNative.Linking.canOpenURL(\"market://details?id=com.spotify.music\")?e.url.openDeeplink(\"market://details?id=com.spotify.music\"):e.url.openDeeplink(\"itms-apps://itunes.apple.com/app/id324684580\")}function ct(t){let{service:n,type:r,id:a,normal:o}=t;const[s,u]=e.React.useState(null);return e.React.useEffect(function(){u(void 0),a&&rt(n,r,a).then(function(f){return u(f!==!1?f:\"N/A\")})},[a]),e.React.createElement(S,{variant:o?\"text-md/semibold\":\"text-md/medium\",color:o?\"TEXT_NORMAL\":\"TEXT_MUTED\"},s??\"-\")}const{FormRow:I}=M.Forms,st={color:\"TEXT_DANGER\",variant:\"text-md/semibold\"};function q(t){let{song:n,remove:r,showAdd:a}=t;const o=e.stylesheet.createThemedStyleSheet({destructiveIcon:{tintColor:b.semanticColors.TEXT_DANGER}});return React.createElement(Ie,null,React.createElement(_e,null,React.createElement(ke,{title:\"Edit Song\",trailing:React.createElement(De,{onPress:O})}),n.service===\"spotify\"&&React.createElement(I,{label:\"Open in Spotify\",leading:React.createElement(I.Icon,{source:p.getAssetIDByName(\"img_account_sync_spotify_light_and_dark\")}),onPress:function(){ot(`spotify://${n.type}/${n.id}`),O()}}),React.createElement(I,{label:\"Copy link\",leading:React.createElement(I.Icon,{source:p.getAssetIDByName(\"copy\")}),onPress:function(){e.clipboard.setString(he(n.service,n.type,n.id)),C.showToast(\"Copied to clipboard.\",p.getAssetIDByName(\"toast_copy_link\")),O()}}),a&&React.createElement(I,{label:\"Add to your profile\",leading:React.createElement(I.Icon,{source:p.getAssetIDByName(\"ic_pin\")}),onPress:function(){O();const s=v.data?.songs;if(!s)return;const u=s.findIndex(function(f){return f===null});if(u===-1)return C.showToast(\"No space left!\",p.getAssetIDByName(\"Small\"));s[u]=n,Z(),C.showToast(\"Added to your profile\",p.getAssetIDByName(\"Check\"))}}),r&&React.createElement(I,{label:React.createElement(S,st,\"Remove song\"),leading:React.createElement(I.Icon,{style:o.destructiveIcon,source:p.getAssetIDByName(\"trash\")}),onPress:function(){r(),C.showToast(\"Removed\",p.getAssetIDByName(\"toast_trash\")),O()}})))}const{ScrollView:lt,View:K}=M.General,{FormRow:B}=M.Forms,ye=l.findByStoreName(\"UserStore\");function ut(){V.useProxy(v),V.useProxy(y),Z();const t=e.stylesheet.createThemedStyleSheet({song:{backgroundColor:b.semanticColors.BG_MOD_FAINT,borderRadius:8},serviceFrame:{height:24,width:24,backgroundColor:b.semanticColors.BG_MOD_FAINT,borderRadius:2147483647}}),n=!!T(),r=!!v.data;return React.createElement(lt,null,React.createElement(ce,{title:\"Songs\",icon:p.getAssetIDByName(\"abc\"),padding:!0},n&&r?React.createElement(K,{style:{flexDirection:\"column\",gap:8}},v.data.songs.map(function(a,o){return React.createElement(B,{label:a===null?\"Press to add song in this position\":React.createElement(ct,{service:a.service,type:a.type,id:a.id,normal:!0}),leading:a===null?React.createElement(K,{style:t.serviceFrame}):React.createElement(e.ReactNative.Image,{style:t.serviceFrame,source:p.getAssetIDByName(\"img_account_sync_spotify_light_and_dark\")}),onLongPress:function(){return a&&X(q,{song:a,remove:function(){return v.data.songs[o]=null}})},onPress:function(){return me.showInputAlert({title:\"Add song\",placeholder:[\"https://open.spotify.com/track/ABC\",\"https://open.spotify.com/album/ABC\",\"https://open.spotify.com/playlist/ABC\",\"https://spotify.link/ABC\"].sort(function(){return Math.random()>.5?1:-1})[0],initialValue:a&&he(a.service,a.type,a.id),cancelText:\"Cancel\",confirmText:\"Save\",onConfirm:async function(s){const u=s.match(Se.HTTP_REGEX_MULTI)?.[0];if(!u)throw new Error(\"Invalid link!\");let f=new URL(u),i=f.hostname,g,m,x;if(i===\"spotify.link\"&&(g=\"spotify\",f=new URL((await fetch(u)).url),i=f.hostname),i===\"open.spotify.com\"){g=\"spotify\";const[N,E,c]=f.pathname.split(\"/\");[\"album\",\"track\",\"playlist\"].includes(E)&&c&&(m=E,x=c)}if(!g||!m||!x)throw new Error(\"Missing service, type or id!\");if(!await it(g,m,x))throw new Error(\"Invalid song!\");v.data.songs[o]={service:g,type:m,id:x}}})},style:t.song})})):n?React.createElement(e.ReactNative.ActivityIndicator,{size:\"small\",style:{flex:1}}):React.createElement(S,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\",align:\"center\"},\"Authenticate first to manage your songs\")),React.createElement(ce,{title:\"Authentication\",icon:p.getAssetIDByName(\"lock\")},T()?React.createElement(React.Fragment,null,React.createElement(B,{label:\"Log out\",subLabel:\"Logs you out of SongSpotlight\",leading:React.createElement(B.Icon,{source:p.getAssetIDByName(\"ic_logout_24px\")}),onPress:function(){var a;(a=y).auth??(a.auth={}),delete y.auth[ye.getCurrentUser().id],delete v.data,C.showToast(\"Successfully logged out\",p.getAssetIDByName(\"ic_logout_24px\"))}}),React.createElement(B,{label:\"Delete data\",subLabel:\"Deletes your SongSpotlight data\",leading:React.createElement(B.Icon,{source:p.getAssetIDByName(\"trash\")}),onPress:async function(){var a;await Ye(),(a=y).auth??(a.auth={}),delete y.auth[ye.getCurrentUser().id],delete v.data,C.showToast(\"Successfully deleted data\",p.getAssetIDByName(\"trash\"))}})):React.createElement(B,{label:\"Authenticate\",leading:React.createElement(B.Icon,{source:p.getAssetIDByName(\"copy\")}),trailing:B.Arrow,onPress:nt})),React.createElement(K,{style:{height:12}}))}const dt=l.findByStoreName(\"ThemeStore\"),ft=function(t,n){return dt.theme!==\"light\"?t:n},F=function(t,n,r){const a=function(i){return i.match(/\\w\\w/g)?.map(function(g){return parseInt(g,16)})??[0,0,0]},o=function(i){return`#${i.map(function(g){return g.toString(16).padStart(2,\"0\")}).join(\"\")}`},s=a(t),u=a(n),f=s.map(function(i,g){return Math.round(i+(u[g]-i)*r)});return o(f)};var pt=`<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12.7 1C12.5143 1 12.3363 1.07375 12.205 1.20503C12.0738 1.3363 12 1.51435 12 1.7V6.85L2.05 1.107C1.94368 1.04561 1.82308 1.01327 1.7003 1.01322C1.57753 1.01316 1.4569 1.0454 1.35053 1.1067C1.24415 1.16799 1.15576 1.25618 1.09424 1.36243C1.03271 1.46867 1.00021 1.58923 1 1.712V14.287C0.999863 14.4099 1.03211 14.5308 1.09349 14.6373C1.15487 14.7438 1.24322 14.8323 1.34966 14.8938C1.4561 14.9553 1.57686 14.9877 1.6998 14.9878C1.82275 14.9878 1.94353 14.9555 2.05 14.894L12 9.149V14.3C12 14.4857 12.0738 14.6637 12.205 14.795C12.3363 14.9262 12.5143 15 12.7 15H14.3C14.4857 15 14.6637 14.9262 14.795 14.795C14.9262 14.6637 15 14.4857 15 14.3V1.7C15 1.51435 14.9262 1.3363 14.795 1.20503C14.6637 1.07375 14.4857 1 14.3 1H12.7Z\" fill=\"white\"/>\n</svg>`,ht=`<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1 12C1 5.925 5.925 1 12 1C18.075 1 23 5.925 23 12C23 18.075 18.075 23 12 23C5.925 23 1 18.075 1 12ZM8.5 7C8.36739 7 8.24021 7.05268 8.14645 7.14645C8.05268 7.24021 8 7.36739 8 7.5V16.5C8 16.6326 8.05268 16.7598 8.14645 16.8536C8.24021 16.9473 8.36739 17 8.5 17H10.5C10.6326 17 10.7598 16.9473 10.8536 16.8536C10.9473 16.7598 11 16.6326 11 16.5V7.5C11 7.36739 10.9473 7.24021 10.8536 7.14645C10.7598 7.05268 10.6326 7 10.5 7H8.5ZM13.5 7C13.3674 7 13.2402 7.05268 13.1464 7.14645C13.0527 7.24021 13 7.36739 13 7.5V16.5C13 16.6326 13.0527 16.7598 13.1464 16.8536C13.2402 16.9473 13.3674 17 13.5 17H15.5C15.6326 17 15.7598 16.9473 15.8536 16.8536C15.9473 16.7598 16 16.6326 16 16.5V7.5C16 7.36739 15.9473 7.24021 15.8536 7.14645C15.7598 7.05268 15.6326 7 15.5 7H13.5Z\" fill=\"white\"/>\n</svg>`,yt=`<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1 12C1 5.925 5.925 1 12 1C18.075 1 23 5.925 23 12C23 18.075 18.075 23 12 23C5.925 23 1 18.075 1 12ZM9.75 7.433C9.67399 7.38912 9.58777 7.36601 9.5 7.36601C9.41224 7.36601 9.32601 7.38911 9.25001 7.433C9.174 7.47688 9.11088 7.54 9.06699 7.616C9.02311 7.69201 9 7.77823 9 7.866V16.134C9 16.2218 9.02311 16.308 9.06699 16.384C9.11088 16.46 9.174 16.5231 9.25001 16.567C9.32601 16.6109 9.41224 16.634 9.5 16.634C9.58777 16.634 9.67399 16.6109 9.75 16.567L16.911 12.433C16.987 12.3891 17.0501 12.326 17.094 12.25C17.1379 12.174 17.161 12.0878 17.161 12C17.161 11.9122 17.1379 11.826 17.094 11.75C17.0501 11.674 16.987 11.6109 16.911 11.567L9.75 7.433Z\" fill=\"white\"/>\n</svg>`,gt=`<!doctype html>\n<html></html>\n<script>\n const RNWV = window.ReactNativeWebView;\n\n /** @type {(HTMLAudioElement | null)[]} */\n const audios = AUDIOS_VARIABLE.map((x) => (x ? new Audio(x) : null));\n let position = 0;\n\n /** @argument enabled {boolean} */\n const playback = (enabled) => {\n audios.forEach((x, i) => {\n if (!x) return;\n if (i === position && enabled) x.play();\n else {\n if (i !== position) x.currentTime = 0;\n x.pause();\n }\n });\n };\n\n audios.forEach((x) =>\n x?.addEventListener(\"ended\", () => RNWV.postMesssage(\"ended\")),\n );\n\n window.addEventListener(\"message\", (ev) => {\n const { action, pos } = ev.data;\n if (!action) return;\n\n if (pos !== undefined) position = audios[pos] ? pos : 0;\n\n if (action === \"play\") playback(true);\n else if (action === \"pause\") playback(false);\n });\n<\\/script>`;const{View:w}=M.General,Rt=e.ReactNative.Animated.createAnimatedComponent(e.ReactNative.Pressable),wt=l.findByName(\"UserProfileSection\"),{YouScreenProfileCard:vt}=l.findByProps(\"YouScreenProfileCard\"),{TableRowGroupTitle:Et}=l.findByProps(\"TableRowGroupTitle\"),Ct=l.findByStoreName(\"UserStore\"),ee=new Map,bt=function(t){let{song:n,showAdd:r,remove:a}=t;const[o,s]=e.React.useState(!1),[u,f]=e.React.useState(0),[i,g]=e.React.useState(void 0),m=i&&i.type===\"track\"||n.type===\"track\"?600/152:600/352,x=e.React.useRef(null),N=e.React.useRef(Math.random().toString()).current;e.React.useEffect(function(){o&&ee.forEach(function(h,d){return d!==N&&h()}),x.current?.injectJavaScript(`window.postMessage(${JSON.stringify({action:o?\"play\":\"pause\",pos:u})})`)},[o,u]),ee.set(N,function(){return s(!1)}),e.React.useEffect(function(){return function(){ee.delete(N)}},[]);const E=i&&(i.coverArt.extractedColors.colorLight?ft(i.coverArt.extractedColors.colorDark.hex,i.coverArt.extractedColors.colorLight.hex):i.coverArt.extractedColors.colorDark.hex),c=e.stylesheet.createThemedStyleSheet({emptyCard:{width:\"100%\",aspectRatio:m,backgroundColor:b.semanticColors.BG_MOD_FAINT,borderRadius:12,justifyContent:\"center\",alignItems:\"center\"},noImage:{tintColor:b.semanticColors.TEXT_DANGER,width:36,height:36},card:{width:\"100%\",backgroundColor:E&&F(E,\"#000000\",.15),aspectRatio:m,borderRadius:12,flexDirection:\"column\"},cardFirst:{backgroundColor:E,width:\"100%\",height:\"100%\",borderRadius:12},cardFirstContent:{flexDirection:\"row\",gap:8,padding:10},cardImage:{height:\"100%\",aspectRatio:1,borderRadius:8,backgroundColor:b.semanticColors.BG_MOD_SUBTLE,shadowColor:\"#000\",shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:4.65,elevation:8},cardContent:{width:\"90%\",flexDirection:\"column\",gap:2,justifyContent:\"center\",flexGrow:0,flexShrink:0},cardContentArtist:{flexDirection:\"row\",gap:4,alignItems:\"center\",flexGrow:0,flexShrink:0},cardContentTag:{backgroundColor:\"#ffffffb3\",paddingHorizontal:6,paddingVertical:1,borderRadius:4,color:\"#000000\"},cardOther:{position:\"absolute\",width:\"100%\",height:\"100%\",flexDirection:\"column\",justifyContent:\"space-between\",alignItems:\"flex-end\",padding:10},cardOtherBottom:{flexDirection:\"row-reverse\",alignItems:\"center\",gap:4},cardTracklist:{height:\"100%\",paddingHorizontal:8,flexDirection:\"column\"},cardTracklistEntry:{backgroundColor:E&&F(E,\"#000000\",.25),borderRadius:5,flexDirection:\"column\",padding:8,flexGrow:0,flexShrink:0},cardTracklistEntryUnplayable:{backgroundColor:E&&F(E,\"#000000\",.2)},cardTracklistEntryPlaying:{backgroundColor:E&&F(E,\"#000000\",.35)},cardTracklistEntryTitle:{width:\"95%\",color:\"#ffffff\"},cardTracklistEntryOther:{position:\"absolute\",width:\"100%\",height:\"100%\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"flex-end\",padding:5},webview:{display:\"none\",width:0,height:0,opacity:0},secondaryText:{opacity:.7,color:\"#ffffff\"},unplayableItem:{opacity:.5},androidRipple:{color:b.semanticColors.ANDROID_RIPPLE,cornerRadius:2147483647},androidRippleTwo:{color:b.semanticColors.ANDROID_RIPPLE,cornerRadius:8}}),ne=e.React.useRef(null),ve=function(){ne.current?.abort();const h=new AbortController;ne.current=h,g(void 0),at(n.service,n.type,n.id,h.signal).then(function(d){const R=d??!1;R&&R.type!==\"track\"&&(R.trackList=R.trackList.slice(0,50)),g(R)}).catch(function(d){return d?.name!==\"AbortError\"&&(C.showToast(`${d}`,p.getAssetIDByName(\"Small\")),g(!1))})};e.React.useEffect(function(){return ve(),function(){return ne.current?.abort()}},[]);const Pt=i&&i.coverArt.sources.sort(function(h,d){return h.width*h.height-d.width*d.height})[0],Ee=e.React.useRef();e.React.useEffect(function(){Ee.current?.scrollToIndex({animated:!0,index:u,viewOffset:16})},[u]);const Tt=function(h){let{item:d,selected:R,playable:A,jump:_,more:j}=h;return e.React.createElement(Rt,{android_ripple:c.androidRippleTwo,style:[c.cardTracklistEntry,!A&&c.cardTracklistEntryUnplayable,R&&c.cardTracklistEntryPlaying],onPress:_,onLongPress:j},e.React.createElement(S,{style:[c.cardTracklistEntryTitle,!A&&c.unplayableItem],variant:R?\"text-sm/bold\":\"text-sm/semibold\",lineClamp:1},d.title),e.React.createElement(w,{style:c.cardContentArtist},d.isExplicit&&e.React.createElement(S,{variant:\"text-xs/semibold\",style:[c.cardContentTag,!A&&c.unplayableItem]},\"E\"),e.React.createElement(S,{variant:R?\"text-xs/bold\":\"text-xs/semibold\",style:[c.secondaryText,!A&&c.unplayableItem],lineClamp:1},d.subtitle)),e.React.createElement(w,{style:c.cardTracklistEntryOther},e.React.createElement(e.ReactNative.Pressable,{android_ripple:c.androidRipple,onPress:j},e.React.createElement(e.ReactNative.Image,{source:p.getAssetIDByName(\"ic_feed_more\")}))))},It=i&&i.type===\"track\"?i.isPlayable&&!!i.audioPreview?.url:!0,Ce=8*2+H[\"text-sm/normal\"].lineHeight+H[\"text-xs/normal\"].lineHeight+1.4;return i?e.React.createElement(e.React.Fragment,null,e.React.createElement(w,{style:c.card,pointerEvents:\"box-none\"},e.React.createElement(w,{style:[c.cardFirst,i.type!==\"track\"&&{height:\"40%\"}]},e.React.createElement(w,{style:c.cardFirstContent},e.React.createElement(e.ReactNative.Image,{style:c.cardImage,source:{uri:Pt.url}}),e.React.createElement(w,{style:c.cardContent},e.React.createElement(S,{variant:\"text-sm/bold\",style:{color:\"#ffffff\"},lineClamp:1},i.title),i.type===\"track\"?e.React.createElement(w,{style:c.cardContentArtist},i.isExplicit&&e.React.createElement(S,{variant:\"text-xs/semibold\",style:c.cardContentTag},\"E\"),e.React.createElement(S,{variant:\"text-xs/semibold\",style:c.secondaryText,lineClamp:1},i.artists.map(function(h){return h.name}).join(\", \"))):e.React.createElement(S,{variant:\"text-xs/semibold\",style:[c.secondaryText,{color:\"#ffffff\"}],lineClamp:1},i.subtitle))),e.React.createElement(w,{style:c.cardOther},e.React.createElement(e.ReactNative.Pressable,{android_ripple:c.androidRipple,onPress:function(){return X(q,{song:n,showAdd:r,remove:a})}},e.React.createElement(e.ReactNative.Image,{source:p.getAssetIDByName(\"ic_feed_more\")})),e.React.createElement(w,{style:c.cardOtherBottom},e.React.createElement(e.ReactNative.Pressable,{android_ripple:c.androidRipple,onPress:function(){return s(!o)},style:!It&&c.unplayableItem},e.React.createElement(oe,{width:30,height:30,xml:o?ht:yt})),i.type!==\"track\"&&e.React.createElement(e.ReactNative.Pressable,{android_ripple:c.androidRipple,onPress:function(){s(!1);const h=u+1;if(h<i.trackList.length){const d=i.trackList[h];if(d.isPlayable&&d.audioPreview?.url)f(h),s(!0);else{const R=i.trackList.findIndex(function(A,_){return _>h&&A.isPlayable&&!!A.audioPreview?.url});R!==-1&&(f(R),s(!0)),C.showToast(\"The next song cannot be played\")}}else f(0)}},e.React.createElement(oe,{width:20,height:20,xml:pt}))))),i.type!==\"track\"&&e.React.createElement(e.ReactNative.FlatList,{nestedScrollEnabled:!0,ref:Ee,getItemLayout:function(h,d){return{length:Ce,offset:8*(d+1)+Ce*d,index:d}},style:c.cardTracklist,data:i.trackList,ListHeaderComponent:function(){return e.React.createElement(w,{style:{height:8}})},ListFooterComponent:function(){return e.React.createElement(w,{style:{height:8}})},ItemSeparatorComponent:function(){return e.React.createElement(w,{style:{height:8}})},renderItem:function(h){let{item:d,index:R}=h;const A=d.isPlayable&&!!d.audioPreview?.url;return e.React.createElement(Tt,{item:d,selected:R===u,playable:A,jump:function(){if(A)f(R),s(!0);else{const _=i.trackList.findIndex(function(j,Bt){return Bt>R&&j.isPlayable&&!!j.audioPreview?.url});return _!==-1&&(f(_),s(!0)),C.showToast(\"This song cannot be played\")}},more:function(){return X(q,{song:{service:\"spotify\",type:\"track\",id:d.uid},showAdd:r})}})}})),i.isPlayable&&e.React.createElement(Le,{source:{html:gt.replace(/AUDIOS_VARIABLE/g,JSON.stringify(i.type===\"track\"?[i.audioPreview?.url??null]:i.trackList.map(function(h){return h.audioPreview?.url??null})))},style:c.webview,mediaPlaybackRequiresUserAction:!1,onMessage:function(h){let{nativeEvent:{data:d}}=h;if(d===\"ended\"&&(s(!1),i.type!==\"track\")){const R=u+1;R<i.trackList.length?(f(R),s(!0)):f(0)}},ref:x,pointerEvents:\"none\"})):i===!1?e.React.createElement(w,{style:c.emptyCard},e.React.createElement(e.ReactNative.Pressable,{android_ripple:c.androidRipple,onPress:ve},e.React.createElement(e.ReactNative.Image,{style:c.noImage,source:p.getAssetIDByName(\"ic_message_retry\"),resizeMode:\"contain\"}))):e.React.createElement(w,{style:c.emptyCard},e.React.createElement(e.ReactNative.ActivityIndicator,{size:\"large\"}))};function ge(t){let{userId:n,you:r}=t;const[a,o]=e.React.useState(void 0),s=Ct.getCurrentUser().id;e.React.useEffect(function(){s===n&&v.data?o(v.data.songs):We(n).then(function(i){return o(i?.songs??[])}).catch(function(i){return C.showToast(`${i}`,p.getAssetIDByName(\"Small\")),o([])})},[]);const u=a&&!a.filter(function(i){return!!i}).length,f=a?a.map(function(i,g){return i?i.service===\"spotify\"&&e.React.createElement(bt,{song:i,showAdd:n!==s&&!!T(),remove:n===s&&function(){const m=v.data?.songs;m&&(m[g]=null,Z())}}):null}):e.React.createElement(e.ReactNative.ActivityIndicator,{size:\"small\",style:{flex:1}});return!u&&(r?e.React.createElement(vt,null,e.React.createElement(Et,{title:\"Song Spotlight\"}),e.React.createElement(w,{style:{flexDirection:\"column\",gap:8,marginTop:4}},f)):e.React.createElement(wt,{title:\"Song Spotlight\",showContainer:!0},e.React.createElement(w,{style:{flexDirection:\"column\",gap:8,paddingHorizontal:8,paddingVertical:8}},f)))}const St=l.findByName(\"UserProfileBio\",!1),mt=l.findByName(\"YouAboutMeCard\",!1);function xt(){const t=new Array;return t.push(ae.after(\"default\",St,function(n,r){let[a]=n;return e.React.createElement(e.React.Fragment,{},[a?.displayProfile?.userId&&e.React.createElement(ge,{userId:a.displayProfile.userId,you:!1}),r])})),t.push(ae.after(\"default\",mt,function(n,r){let[{userId:a}]=n;return e.React.createElement(e.React.Fragment,{},[e.React.createElement(ge,{userId:a,you:!0}),r])})),function(){return t.forEach(function(n){return n()})}}const y=be.storage;let Re;const v=V.wrapSync(V.createStorage({get:function(){return Re},set:function(t){Re=t}}));async function te(){try{v.data=await Je()}catch{return}}let we;var At={onLoad:function(){T()&&te(),we=xt()},onUnload:function(){return we?.()},settings:ut};return k.cache=v,k.default=At,k.fillCache=te,k.vstorage=y,Object.defineProperty(k,\"__esModule\",{value:!0}),k})({},vendetta.plugin,vendetta.storage,vendetta.constants,vendetta.metro,vendetta.metro.common,vendetta.ui,vendetta.ui.alerts,vendetta.ui.assets,vendetta.ui.components,vendetta.ui.toasts,vendetta,vendetta.utils,vendetta.patcher);\n"}}a.patcher);\n"}} >
This log will be saved for 90 days from their last view.
Report abuse