framer-api 0.1.4-alpha.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import {env,isDeno,isWorkerd}from'std-env';import*as ue from'devalue';/* Framer API SDK v0.1.4-alpha.2 */
1
+ import {env,isDeno,isWorkerd}from'std-env';import*as ue from'devalue';/* Framer API SDK v0.1.5 */
2
2
  var Jr=Object.defineProperty;var r=(n,e)=>Jr(n,"name",{value:e,configurable:true});function ct(n){return n!==void 0}r(ct,"isDefined");function oi(n){return n===void 0}r(oi,"isUndefined");function C(n){return n===null}r(C,"isNull");function ai(n){return n!==null}r(ai,"isNotNull");function Pe(n){return n===true||n===false}r(Pe,"isBoolean");function f(n){return typeof n=="string"}r(f,"isString");function q(n){return typeof n=="number"&&Number.isFinite(n)}r(q,"isNumber");function Qr(n){return typeof n=="function"}r(Qr,"isFunction");function N(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}r(N,"isObject");function pt(n){if(typeof n!="object"||n===null)return false;let e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}r(pt,"isPlainObject");function Ht(n){return Array.isArray(n)}r(Ht,"isArray");function Se(n,e){throw e||new Error(n?`Unexpected value: ${n}`:"Application entered invalid state")}r(Se,"assertNever");function c(n,...e){if(n)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let i=t.stack.split(`
3
3
  `);i[1]?.includes("assert")?(i.splice(1,1),t.stack=i.join(`
4
4
  `)):i[0]?.includes("assert")&&(i.splice(0,1),t.stack=i.join(`
5
- `));}catch{}throw t}r(c,"assert");function P(n){for(let e of Reflect.ownKeys(n)){let t=n[e];!t||typeof t!="object"&&!Qr(t)||P(t);}return Object.freeze(n)}r(P,"deepFreeze");function si(n){return [n.slice(0,-1),n.at(-1)]}r(si,"splitRestAndLast");var g="__class";var _t=Symbol(),qt=Symbol(),Yt=Symbol(),Xt=Symbol(),eo=Symbol(),to=Symbol(),no=Symbol(),io=Symbol(),ro=Symbol(),Zt=Symbol(),Jt=Symbol(),l={getAiServiceInfo:_t,sendTrackingEvent:qt,getCurrentUser:Yt,getProjectInfo:Xt,environmentInfo:eo,initialState:to,showUncheckedPermissionToasts:no,marshal:io,unmarshal:ro,getHTMLForNode:Zt,setHTMLForNode:Jt},pe="INTERNAL_",mt=`${pe}getAiServiceInfo`,gt=`${pe}sendTrackingEvent`,ft=`${pe}getCurrentUser`,yt=`${pe}getProjectInfo`,me=`${pe}getHTMLForNode`,ge=`${pe}setHTMLForNode`;var M=class{static{r(this,"VariableBase");}#e;#t;get nodeId(){return this.#t.nodeId}get nodeType(){return this.#t.nodeType}get id(){return this.#t.id}get name(){return this.#t.name}get description(){return this.#t.description??null}constructor(e,t){this.#e=e,this.#t=t;}async setAttributes(e){let t=await this.#e.invoke("updateVariable",this.nodeId,this.id,{...e,type:this.type});if(C(t))return null;let i=this.constructor;return new i(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},w="Variable";function V(n){let e=n.at(0);return c(!oi(e)),`${e.toLowerCase()}${n.slice(1,-w.length)}`}r(V,"classToType");var oo=`Boolean${w}`,ao=V(oo),Fe=class n extends M{static{r(this,"BooleanVariable");}type=ao;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},so=`Number${w}`,lo=V(so),De=class n extends M{static{r(this,"NumberVariable");}type=lo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},uo=`String${w}`,co=V(uo),ve=class n extends M{static{r(this,"StringVariable");}type=co;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},po=`FormattedText${w}`,mo=V(po),Ne=class n extends M{static{r(this,"FormattedTextVariable");}type=mo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},go=`Enum${w}`,fo=V(go),Y=class n{static{r(this,"EnumCase");}#e;#t;#n;#i;get id(){return this.#i.id}get name(){return this.#i.name}get nameByLocale(){return this.#i.nameByLocale}constructor(e,t,i,o){this.#e=e,this.#t=t,this.#n=i,this.#i=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#n,this.id,e);return t?new n(this.#e,this.#t,this.#n,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#n,this.id);}},ke=class n extends M{static{r(this,"EnumVariable");}type=fo;#e;#t;#n;get cases(){return this.#n||(this.#n=P(this.#t.cases.map(e=>new Y(this.#e,this.nodeId,this.id,e)))),this.#n}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new Y(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},yo=`Color${w}`,ho=V(yo),Ee=class n extends M{static{r(this,"ColorVariable");}type=ho;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},bo=`Image${w}`,xo=V(bo),Me=class n extends M{static{r(this,"ImageVariable");}type=xo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Co=`File${w}`,Io=V(Co),Ae=class n extends M{static{r(this,"FileVariable");}type=Io;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},To=`Link${w}`,Po=V(To),we=class n extends M{static{r(this,"LinkVariable");}type=Po;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},So=`Date${w}`,Fo=V(So),Ve=class n extends M{static{r(this,"DateVariable");}type=Fo;#e;get displayTime(){return this.#e.displayTime}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Do=`Border${w}`,vo=V(Do),We=class n extends M{static{r(this,"BorderVariable");}type=vo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},No=`Unsupported${w}`,ko=V(No),Le=class n extends M{static{r(this,"UnsupportedVariable");}type=ko;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}};function li(n){return n instanceof M}r(li,"isVariable");function Eo(n){return li(n)&&n.nodeType==="component"}r(Eo,"isComponentVariable");var R=class{static{r(this,"FieldBase");}#e;#t;#n;get id(){return this.#n.id}get name(){return this.#n.name}constructor(e,t,i){this.#e=e,this.#t=t,this.#n=i;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[i]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(c(ct(i)),C(i))return null;c(i.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,i)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},L=class extends R{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,i){super(e,t,i),this.#e=i;}},ht=class extends R{static{r(this,"BooleanField");}type=tn},bt=class extends R{static{r(this,"ColorField");}type=nn},xt=class extends R{static{r(this,"NumberField");}type=rn},Ct=class extends L{static{r(this,"StringField");}type=on;#e;constructor(e,t,i){super(e,t,i),this.#e=i;}get basedOn(){return this.#e.basedOn}},It=class extends L{static{r(this,"FormattedTextField");}type=an},Re=class extends L{static{r(this,"ImageField");}type=sn},Tt=class extends L{static{r(this,"LinkField");}type=dn},Pt=class extends L{static{r(this,"DateField");}type=un;#e;get displayTime(){return this.#e.displayTime}constructor(e,t,i){super(e,t,i),this.#e=i;}},St=class extends R{static{r(this,"FieldDivider");}type=fn},Be=class extends R{static{r(this,"UnsupportedField");}type=yn},Ft=class extends L{static{r(this,"FileField");}type=cn;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,i){super(e,t,i),this.#e=i;}},Dt=class extends R{static{r(this,"EnumField");}type=pn;#e;#t;#n;#i;get cases(){return this.#i||(this.#i=this.#n.cases.map(e=>new Y(this.#e,this.#t,this.id,e)),P(this.#i)),this.#i}constructor(e,t,i){super(e,t,i),this.#e=e,this.#t=t,this.#n=i;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new Y(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},vt=class extends L{static{r(this,"CollectionReferenceField");}type=mn;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},Nt=class extends L{static{r(this,"MultiCollectionReferenceField");}type=gn;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},Qt=class extends L{static{r(this,"ArrayField");}type=ln;fields;constructor(e,t,i){super(e,t,i);let o=i.fields[0];this.fields=[new Re(e,t,o)];}};function en(n,e,t){return n.map(i=>{switch(i.type){case tn:return new ht(e,t,i);case nn:return new bt(e,t,i);case rn:return new xt(e,t,i);case on:return new Ct(e,t,i);case an:return new It(e,t,i);case sn:return new Re(e,t,i);case dn:return new Tt(e,t,i);case un:return new Pt(e,t,i);case fn:return new St(e,t,i);case yn:return new Be(e,t,i);case cn:return new Ft(e,t,i);case pn:return new Dt(e,t,i);case mn:return new vt(e,t,i);case gn:return new Nt(e,t,i);case ln:return new Qt(e,t,i);default:return new Be(e,t,i)}})}r(en,"fieldDefinitionDataArrayToFieldClassInstances");function Mo(n){return n instanceof R}r(Mo,"isField");var di="action";function Ao(n){return !!n&&di in n&&f(n[di])}r(Ao,"isLocalizedValueUpdate");function ui(n){return Object.keys(n).reduce((e,t)=>{let i=n[t];return Ao(i)&&(e[t]=i),e},{})}r(ui,"filterInlineLocalizationValues");var Ue=class n{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new n(t)}[l.marshal](){return {[g]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function wo(n){return n instanceof Ue}r(wo,"isFileAsset");var Vo="ImageAsset";function ci(n){return N(n)?n[g]===Vo:false}r(ci,"isImageAssetData");var X=class n{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return {[g]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new n(this.#t,{[g]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return Ro(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),i=new Blob([t],{type:e});return createImageBitmap(i)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((i,o)=>{let a=new Image;a.onload=()=>i(a),a.onerror=()=>o(),a.src=t;})}};function Wo(n){return n instanceof X}r(Wo,"isImageAsset");function Z(n){return n.type==="bytes"?[n.bytes.buffer]:[]}r(Z,"getTransferable");function Lo(n){if(!N(n))return false;let e="bytes",t="mimeType";return !(!(e in n)||!(t in n)||!(n[e]instanceof Uint8Array)||!f(n[t]))}r(Lo,"isBytesData");async function Oe(n){if(n instanceof File)return xn(n);let e=await pi(n.image);return {name:n.name,altText:n.altText,resolution:n.resolution,preferredImageRendering:n.preferredImageRendering,...e}}r(Oe,"createImageTransferFromInput");async function hn(n){if(n instanceof File)return xn(n);let e=await pi(n.file);return {name:n.name,...e}}r(hn,"createFileTransferFromInput");async function pi(n){return n instanceof File?xn(n):Lo(n)?{type:"bytes",mimeType:n.mimeType,bytes:n.bytes}:{type:"url",url:n}}r(pi,"createAssetTransferFromAssetInput");function bn(n){return Promise.all(n.map(Oe))}r(bn,"createNamedAssetDataTransferFromInput");async function xn(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=o=>{let a=n.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:n.name});},i.onerror=o=>{t(o);},i.readAsArrayBuffer(n);})}r(xn,"getAssetDataFromFile");async function Ro(n){let e=n instanceof File,t=e?URL.createObjectURL(n):n,i=new Image;return i.crossOrigin="anonymous",new Promise((o,a)=>{i.onload=()=>{o({width:i.naturalWidth,height:i.naturalHeight});},i.onerror=s=>{a(s);},i.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(Ro,"measureImage");var kt=class{static{r(this,"ComputedValueBase");}};var Bo="unsupported",ze=class n extends kt{static{r(this,"UnsupportedComputedValue");}type=Bo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new n(t)}[l.marshal](){return this.#e}};function Uo(n){return n instanceof kt}r(Uo,"isComputedValue");var Oo="Font";function gi(n){return N(n)&&n[g]===Oo}r(gi,"isFontData");function zo(n){if(!q(n))return false;switch(n){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(zo,"isFontWeight");function Go(n){if(!f(n))return false;switch(n){case "normal":case "italic":return true;default:return false}}r(Go,"isFontStyle");function fi(n){return N(n)?f(n.family)&&f(n.selector)&&zo(n.weight)&&Go(n.style):false}r(fi,"isFont");var G=class n{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let i=mi.get(t.selector);if(i)return i;let o=new n(t);return mi.set(t.selector,o),o}[l.marshal](){return {[g]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},mi=new Map;var Ko="LinearGradient",$o="RadialGradient",jo="ConicGradient",fe=class{static{r(this,"GradientBase");}#e;get stops(){return this.#e.stops}constructor(e){this.#e=e;}cloneWithAttributes(e){let t=this.constructor;return new t({...this.#e,...e})}},Ge=class n extends fe{static{r(this,"LinearGradient");}[g]=Ko;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:y(e,t.stops)})}[l.marshal](){return B({...this.#e,[g]:this[g]})}toCSS(){let e=this.#e.stops.map(t=>(c(f(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Ke=class n extends fe{static{r(this,"RadialGradient");}[g]=$o;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:y(e,t.stops)})}[l.marshal](){return B({...this.#e,[g]:this[g]})}toCSS(){let e=this.stops.map((t,i)=>{c(f(t.color),"ColorStyle not supported yet");let o=this.stops[i+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},$e=class n extends fe{static{r(this,"ConicGradient");}[g]=jo;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:y(e,t.stops)})}[l.marshal](){return B({...this.#e,[g]:this[g]})}toCSS(){let e=this.stops.map(t=>(c(f(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function yi(n){return n instanceof fe}r(yi,"isGradient");var Ho="ColorStyle";function Et(n){return N(n)?n[g]===Ho:false}r(Et,"isColorStyleData");var ne=class n{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return {[g]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new n(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function ye(n){return n instanceof ne}r(ye,"isColorStyle");var _o="TextStyle";function hi(n){return N(n)?n[g]===_o:false}r(hi,"isTextStyleData");var je=class n{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=G[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&G[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&G[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&G[l.unmarshal](e,t.boldItalicFont),this.color=Et(t.color)?ne[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Et(t.decorationColor)?ne[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return {[g]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:ye(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:ye(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new n(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function Cn(n){return n instanceof je}r(Cn,"isTextStyle");function qo(n){return N(n)&&l.marshal in n}r(qo,"isSelfMarshalable");function B(n){if(qo(n))return n[l.marshal]();if(Ht(n))return n.map(B);if(pt(n)){let e={};for(let t of Object.keys(n))e[t]=B(n[t]);return e}return n}r(B,"marshal");var bi={ColorStyle:ne,ConicGradient:$e,FileAsset:Ue,Font:G,ImageAsset:X,LinearGradient:Ge,RadialGradient:Ke,TextStyle:je,BooleanVariable:Fe,BorderVariable:We,ColorVariable:Ee,DateVariable:Ve,EnumVariable:ke,FileVariable:Ae,FormattedTextVariable:Ne,ImageVariable:Me,LinkVariable:we,NumberVariable:De,StringVariable:ve,UnsupportedVariable:Le,UnsupportedComputedValue:ze};function Yo(n){return pt(n)&&f(n[g])&&n[g]in bi}r(Yo,"isSelfUnmarshalable");function y(n,e){if(Yo(e))return bi[e[g]][l.unmarshal](n,e);if(Ht(e))return e.map(t=>y(n,t));if(pt(e)){let t={};for(let i of Object.keys(e))t[i]=y(n,e[i]);return t}return e}r(y,"unmarshal");var Xo={array:false,boolean:false,collectionReference:false,color:false,date:false,enum:false,file:false,formattedText:false,image:true,link:false,multiCollectionReference:false,number:false,string:false,unsupported:false};function Zo(n){return Xo[n]}r(Zo,"isSupportedArrayItemFieldType");function Jo(n){return Zo(n.type)}r(Jo,"isSupportedArrayItemFieldDataEntry");var tn="boolean",nn="color",rn="number",on="string",an="formattedText",sn="image",ln="array",dn="link",un="date",cn="file",pn="enum",mn="collectionReference",gn="multiCollectionReference",fn="divider",yn="unsupported";function Qo(n){return n.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(i=>{let o=i.nameByLocale?ui(i.nameByLocale):void 0;return {...i,nameByLocale:o}});return {...e,cases:t}})}r(Qo,"sanitizeEnumFieldForMessage");function xi(n,e){let t={};for(let i in n){let o=n[i];if(!o)continue;if(o.type!=="array"){t[i]=y(e,o);continue}let a=o.value.map(s=>{let d=xi(s.fieldData,e),u={};for(let I in d){let S=d[I];c(S&&Jo(S),"Unsupported array item field data entry"),u[I]=S;}return {...s,fieldData:u}});t[i]={...o,value:a};}return t}r(xi,"deserializeFieldData");var he=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,c(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,P(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=Qo(e);return this.#e.invoke("setManagedCollectionFields",this.id,t)}async addItems(e){return this.#e.invoke("addManagedCollectionItems2",this.id,e)}async removeItems(e){return this.#e.invoke("removeManagedCollectionItems",this.id,e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},ie=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,P(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return en(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return c(t.every(ai)),en(t,this.#e,this.id)}async removeFields(e){return this.#e.invoke("removeCollectionFields",this.id,e)}async setFieldOrder(e){return this.#e.invoke("setCollectionFieldOrder",this.id,e)}async getItems(){return (await this.#e.invoke("getCollectionItems2",this.id)).map(t=>new He(t,this.#e))}async addItems(e){await this.#e.invoke("addCollectionItems2",this.id,e);}async removeItems(e){return this.#e.invoke("removeCollectionItems",e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},He=class n{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let i=xi(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=i,this.#e=t,P(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new n(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var ea={fixed:true,sticky:true,absolute:true,relative:true},Ci="position";function il(n){if(!(Ci in n))return false;let e=n[Ci];return f(e)&&ea[e]===true}r(il,"supportsPosition");var Ii="top";function rl(n){if(!(Ii in n))return false;let e=n[Ii];return f(e)||C(e)}r(rl,"supportsPins");var Ti="width";function ol(n){if(!(Ti in n))return false;let e=n[Ti];return f(e)||C(e)}r(ol,"supportsSize");var Pi="maxWidth";function al(n){if(!(Pi in n))return false;let e=n[Pi];return f(e)||C(e)}r(al,"supportsSizeConstraints");var Si="aspectRatio";function sl(n){if(!(Si in n))return false;let e=n[Si];return q(e)||C(e)}r(sl,"supportsAspectRatio");var Fi="name";function ll(n){if(!(Fi in n))return false;let e=n[Fi];return f(e)||C(e)}r(ll,"supportsName");var Di="visible";function dl(n){if(!(Di in n))return false;let e=n[Di];return Pe(e)}r(dl,"supportsVisible");var vi="locked";function ul(n){if(!(vi in n))return false;let e=n[vi];return Pe(e)}r(ul,"supportsLocked");var Ni="backgroundColor";function cl(n){if(!(Ni in n))return false;let e=n[Ni];return f(e)||ye(e)||C(e)}r(cl,"supportsBackgroundColor");var ki="backgroundColor";function pl(n){if(!(ki in n))return false;let e=n[ki];return f(e)||Et(e)||C(e)}r(pl,"supportsBackgroundColorData");var Ei="backgroundImage";function ml(n){if(!(Ei in n))return false;let e=n[Ei];return e instanceof X||C(e)}r(ml,"supportsBackgroundImage");var Mi="backgroundImage";function gl(n){if(!(Mi in n))return false;let e=n[Mi];return e instanceof X?false:ci(e)||C(e)}r(gl,"supportsBackgroundImageData");var Ai="backgroundGradient";function fl(n){if(!(Ai in n))return false;let e=n[Ai];return yi(e)||C(e)}r(fl,"supportsBackgroundGradient");var wi="backgroundGradient";function yl(n){if(!(wi in n))return false;let e=n[wi];return N(e)||C(e)}r(yl,"supportsBackgroundGradientData");var Vi="rotation";function hl(n){if(!(Vi in n))return false;let e=n[Vi];return q(e)}r(hl,"supportsRotation");var Wi="opacity";function bl(n){if(!(Wi in n))return false;let e=n[Wi];return q(e)}r(bl,"supportsOpacity");var Li="borderRadius";function xl(n){if(!(Li in n))return false;let e=n[Li];return f(e)||C(e)}r(xl,"supportsBorderRadius");var Ri="border";function Cl(n){if(!(Ri in n))return false;let e=n[Ri];return C(e)||ye(e.color)}r(Cl,"supportsBorder");var Bi="svg";function Il(n){if(!(Bi in n))return false;let e=n[Bi];return f(e)}r(Il,"supportsSVG");var Ui="textTruncation";function Tl(n){if(!(Ui in n))return false;let e=n[Ui];return q(e)||C(e)}r(Tl,"supportsTextTruncation");var Oi="zIndex";function Pl(n){if(!(Oi in n))return false;let e=n[Oi];return q(e)||C(e)}r(Pl,"supportsZIndex");var zi="overflow";function Sl(n){if(!(zi in n))return false;let e=n[zi];return f(e)||C(e)}r(Sl,"supportsOverflow");var Gi="componentIdentifier";function Fl(n){if(!(Gi in n))return false;let e=n[Gi];return f(e)}r(Fl,"supportsComponentInfo");var Ki="font";function Dl(n){if(!(Ki in n))return false;let e=n[Ki];return fi(e)}r(Dl,"supportsFont");var $i="font";function vl(n){if(!($i in n))return false;let e=n[$i];return gi(e)||C(e)}r(vl,"supportsFontData");var ji="inlineTextStyle";function Nl(n){if(!(ji in n))return false;let e=n[ji];return Cn(e)||C(e)}r(Nl,"supportsInlineTextStyle");var Hi="inlineTextStyle";function kl(n){if(!(Hi in n))return false;let e=n[Hi];return hi(e)||C(e)}r(kl,"supportsInlineTextStyleData");var _i="link";function El(n){if(!(_i in n))return false;let e=n[_i];return f(e)||C(e)}r(El,"supportsLink");var qi="imageRendering";function Ml(n){if(!(qi in n))return false;let e=n[qi];return f(e)||C(e)}r(Ml,"supportsImageRendering");var Yi="layout";function Ji(n){if(!(Yi in n))return false;let e=n[Yi];return f(e)||C(e)}r(Ji,"supportsLayout");function Al(n){return Ji(n)?n.layout==="stack":false}r(Al,"hasStackLayout");function wl(n){return Ji(n)?n.layout==="grid":false}r(wl,"hasGridLayout");var Xi="isVariant";function Qi(n){if(!(Xi in n))return false;let e=n[Xi];return Pe(e)}r(Qi,"supportsComponentVariant");function In(n){return Qi(n)?n.isVariant:false}r(In,"isComponentVariant");function er(n){return !Qi(n)||!In(n)?false:!C(n.gesture)}r(er,"isComponentGestureVariant");var Zi="isBreakpoint";function ta(n){if(!(Zi in n))return false;let e=n[Zi];return Pe(e)}r(ta,"supportsBreakpoint");function tr(n){return ta(n)?n.isBreakpoint:false}r(tr,"isBreakpoint");var W=class{static{r(this,"NodeMethods");}id;originalId;#e;constructor(e,t){this.id=e.id,this.originalId=e.originalId??null,this.#e=t;}get isReplica(){return this.originalId!==null}async remove(){return this.#e.invoke("removeNodes2",[this.id])}async select(){return this.#e.invoke("setSelection",[this.id])}async clone(){return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[g]==="UnknownNode")throw Error("Can not set attributes on unknown node");return this.#e.setAttributes(this.id,e)}async getRect(){return this.#e.invoke("getRect",this.id)}async zoomIntoView(e){return this.#e.invoke("zoomIntoView",[this.id],e)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}async getParent(){return this.#e.getParent(this.id)}async getChildren(){return re(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return re(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(i=>x(i,this.#e))}async getNodesWithAttribute(e){return re(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(i=>x(i,this.#e))}async getNodesWithAttributeSet(e){return re(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(i=>x(i,this.#e))}async*walk(){if(yield this,!re(this))for(let e of await this.getChildren())yield*e.walk();}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}},U=class extends W{static{r(this,"FrameNode");}[g]="FrameNode";name;visible;locked;backgroundColor;backgroundImage;backgroundGradient;rotation;opacity;borderRadius;border;imageRendering;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;zIndex;link;linkOpenInNewTab;linkSmoothScroll;linkClickTrackingId;linkRelValues;linkPreserveParams;overflow;overflowX;overflowY;layout;gap;padding;stackDirection;stackDistribution;stackAlignment;stackWrapEnabled;gridColumnCount;gridRowCount;gridAlignment;gridColumnWidthType;gridColumnWidth;gridColumnMinWidth;gridRowHeightType;gridRowHeight;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;isVariant;isPrimaryVariant;isBreakpoint;isPrimaryBreakpoint;inheritsFromId;gesture;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.backgroundColor=y(t,e.backgroundColor)??null,this.backgroundImage=y(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=y(t,e.border)??null,this.backgroundGradient=y(t,e.backgroundGradient)??null,this.imageRendering=e.imageRendering??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,this.zIndex=e.zIndex??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.linkSmoothScroll=e.linkSmoothScroll??null,this.linkClickTrackingId=e.linkClickTrackingId??null,this.linkRelValues=e.linkRelValues??null,this.linkPreserveParams=e.linkPreserveParams??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.layout=e.layout??null,this.gap=e.gap??null,this.padding=e.padding??null,this.stackDirection=e.stackDirection??null,this.stackDistribution=e.stackDistribution??null,this.stackAlignment=e.stackAlignment??null,this.stackWrapEnabled=e.stackWrapEnabled??null,this.gridColumnCount=e.gridColumnCount??null,this.gridRowCount=e.gridRowCount??null,this.gridAlignment=e.gridAlignment??null,this.gridColumnWidthType=e.gridColumnWidthType??null,this.gridColumnWidth=e.gridColumnWidth??null,this.gridColumnMinWidth=e.gridColumnMinWidth??null,this.gridRowHeightType=e.gridRowHeightType??null,this.gridRowHeight=e.gridRowHeight??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,this.inheritsFromId=e.inheritsFromId??null,this.gesture=e.gesture??null,this.isVariant=e.isVariant??false,this.isPrimaryVariant=e.isPrimaryVariant??false,this.isBreakpoint=e.isBreakpoint??false,this.isPrimaryBreakpoint=e.isPrimaryBreakpoint??false,P(this);}},oe=class extends W{static{r(this,"TextNode");}[g]="TextNode";name;visible;locked;rotation;opacity;zIndex;font;inlineTextStyle;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;link;linkOpenInNewTab;linkSmoothScroll;linkClickTrackingId;linkRelValues;linkPreserveParams;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;overflow;overflowX;overflowY;textTruncation;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.zIndex=e.zIndex??null,this.font=y(t,e.font)??null,this.inlineTextStyle=y(t,e.inlineTextStyle)??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.linkSmoothScroll=e.linkSmoothScroll??null,this.linkClickTrackingId=e.linkClickTrackingId??null,this.linkRelValues=e.linkRelValues??null,this.linkPreserveParams=e.linkPreserveParams??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.textTruncation=e.textTruncation??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,P(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(ge,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(me,this.id)}},_e=class extends W{static{r(this,"SVGNode");}[g]="SVGNode";name;visible;locked;svg;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.svg=e.svg,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,P(this);}},qe=class extends W{static{r(this,"VectorSetItemNode");}[g]="VectorSetItemNode";name;visible;locked;top;right;bottom;left;centerX;centerY;width;height;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.top=e.top??null,this.right=e.right??null,this.bottom=e.bottom??null,this.left=e.left??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,P(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ye=class extends W{static{r(this,"ComponentInstanceNode");}[g]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#n;get typedControls(){return this.#n||(this.#n=y(this.#e,this.#t.typedControls)??{}),this.#n}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=y(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,P(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},K=class extends W{static{r(this,"WebPageNode");}[g]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,P(this);}async clone(e){return this.#e.cloneWebPage(this.id,e)}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let i=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=x(i,this.#e);return c(o instanceof U),c(tr(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new He(e,this.#e):null}},ae=class extends W{static{r(this,"ComponentNode");}[g]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,P(this);}async addVariant(e,t){let i=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!i)throw new Error("Failed to add variant to component");let o=x(i,this.#e);return c(o instanceof U),c(In(o),"Node is not a component variant"),o}async addGestureVariant(e,t,i){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,i);if(!o)throw new Error("Failed to add state to component");let a=x(o,this.#e);return c(a instanceof U),c(er(a),"Node is not a gesture variant"),a}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return y(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,B(e));return y(this.#e,t)}async removeVariables(e){await this.#e.invoke("removeVariables",this.id,e);}async setVariableOrder(e){await this.#e.invoke("setVariableOrder",this.id,e);}},Xe=class extends W{static{r(this,"VectorSetNode");}[g]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,P(this);}},$=class extends W{static{r(this,"DesignPageNode");}[g]="DesignPageNode";name;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,P(this);}async clone(e){return this.#e.cloneDesignPage(this.id,e)}},Ze=class extends W{static{r(this,"UnknownNode");}[g]="UnknownNode";constructor(e,t){super(e,t),P(this);}async clone(){throw new Error("Cannot clone an unknown node")}};function x(n,e){switch(n[g]){case "DesignPageNode":return new $(n,e);case "WebPageNode":return new K(n,e);case "ComponentNode":return new ae(n,e);case "VectorSetNode":return new Xe(n,e);case "VectorSetItemNode":return new qe(n,e);case "ComponentInstanceNode":return new Ye(n,e);case "FrameNode":return new U(n,e);case "SVGNode":return new _e(n,e);case "TextNode":return new oe(n,e);case "UnknownNode":return new Ze(n,e);default:return new Ze(n,e)}}r(x,"convertRawNodeDataToNode");function Mt(n){return n instanceof U}r(Mt,"isFrameNode");function nr(n){return n instanceof oe}r(nr,"isTextNode");function ir(n){return n instanceof _e}r(ir,"isSVGNode");function be(n){return n instanceof Ye}r(be,"isComponentInstanceNode");function rr(n){return n instanceof K}r(rr,"isWebPageNode");function or(n){return n instanceof ae}r(or,"isComponentNode");function ar(n){return n instanceof $}r(ar,"isDesignPageNode");function sr(n){return n instanceof Xe}r(sr,"isVectorSetNode");function lr(n){return n instanceof qe}r(lr,"isVectorSetItemNode");function re(n){return n instanceof Ze}r(re,"isUnknownNode");function Je(n){return !!(Mt(n)||nr(n)||be(n)||ir(n)||lr(n)||re(n))}r(Je,"isCanvasNode");function Tn(n){return !!(rr(n)||ar(n)||or(n)||sr(n)||re(n))}r(Tn,"isCanvasRootNode");var Qe=class{static{r(this,"VectorSet");}id;name;owner;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.owner=e.owner,this.#e=t;}async getItems(){return (await this.#e.invoke("getVectorSetItems",this.id)).map(t=>new At(t,this.#e))}},At=class{static{r(this,"VectorSetItem");}id;name;insertUrl;iconUrl;#e;#t;constructor(e,t){this.id=e.id,this.name=e.name,this.insertUrl=e.insertUrl,this.iconUrl=e.iconUrl,this.#e=e.moduleId,this.#t=t;}async getVariables(){return this.#t.invoke("getVectorSetItemVariables",this.id,this.#e)}};var et=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},J=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function na(n){return n.type==="separator"}r(na,"isSeparatorMenuItem");function wt(n,e){let t=[];for(let i of n){if(na(i)){t.push(i);continue}let{onAction:o,...a}=i,s=a;if(i.onAction){let d=Math.random();e.set(d,i.onAction),s.actionId=d;}i.submenu&&(s.submenu=wt(i.submenu,e)),t.push(s);}return t}r(wt,"addMenuItemsToOnActionCallbackMap");var Vt="type",dr={[Vt]:"pluginReadySignal"},ra="pluginReadyResponse";var oa={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function ur(n){return N(n)&&f(n[Vt])&&n[Vt]in oa}r(ur,"isVekterToPluginNonHandshakeMessage");function cr(n){return N(n)&&n[Vt]===ra}r(cr,"isPluginReadyResponse");var Pn=Symbol(),Sn=Symbol(),Fn=Symbol(),Dn=Symbol(),vn=Symbol(),Nn=Symbol(),kn=Symbol(),En=Symbol(),Mn=Symbol(),An=Symbol(),wn=Symbol(),Vn=Symbol(),Wn=Symbol(),Ln=Symbol(),v={publish:Pn,getDeployments:Sn,deploy:Fn,getChangedPaths:Dn,getChangeContributors:vn,createManagedCollection:Nn,rejectAllPending:kn,readProjectForAgent:En,getAgentSystemPrompt:Mn,getAgentContext:An,applyAgentChanges:wn,startAgentConversation:Vn,continueAgentConversation:Wn,submitAgentClarification:Ln};function Rn(n){return typeof n=="string"&&n in v}r(Rn,"isFramerApiOnlyMethod");var aa=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions","lintCode"],sa=["closeNotification","closePlugin","setCloseWarning","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocaleLanguages","getLocaleRegions","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","typecheckCode","getCodeFileVersions","getCodeFiles","getCodeFile","getRedirects","uploadFile","uploadFiles","uploadImage","uploadImages","zoomIntoView","navigateTo","getRuntimeErrorForModule","getRuntimeErrorForCodeComponentNode","showProgressOnInstances","removeProgressFromInstances","addComponentInstancePlaceholder","updateComponentInstancePlaceholder","removeComponentInstancePlaceholder","setMenu","showContextMenu","getBreakpointSuggestionsForWebPage","getActiveCollectionItemForWebPage","getVariables","getVectorSets","getVectorSetItems","getVectorSetItemVariables","getChangedPaths","getChangeContributors","getDeployments","readProjectForAgent","getAgentSystemPrompt","getAgentContext",mt,gt,ft,yt,me,"getAiServiceInfo","sendTrackingEvent",...aa];new Set(sa);var Bn={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],setCloseWarning:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],createLocale:["createLocale"],getLocaleLanguages:[],getLocaleRegions:[],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields2"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields2"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode","cloneWebPage","cloneDesignPage"],"WebPageNode.clone":["cloneWebPage"],"DesignPageNode.clone":["cloneDesignPage"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[ge],"TextNode.getHTML":[],"ComponentNode.addVariant":["addVariantToComponent"],"ComponentNode.addGestureVariant":["addGestureVariantToComponent"],"ComponentNode.getVariables":[],"ComponentNode.addVariables":["addVariables"],"ComponentNode.removeVariables":["removeVariables"],"WebPageNode.getBreakpointSuggestions":[],"WebPageNode.addBreakpoint":["addBreakpointToWebPage"],"WebPageNode.getActiveCollectionItem":[],"ColorStyle.getPluginData":[],"ColorStyle.getPluginDataKeys":[],"ColorStyle.remove":["removeColorStyle"],"ColorStyle.setAttributes":["setColorStyleAttributes"],"ColorStyle.setPluginData":["setPluginDataForNode"],"TextStyle.getPluginData":[],"TextStyle.getPluginDataKeys":[],"TextStyle.remove":["removeTextStyle"],"TextStyle.setAttributes":["setTextStyleAttributes"],"TextStyle.setPluginData":["setPluginDataForNode"],"Variable.setAttributes":["updateVariable"],"Variable.remove":["removeVariables"],"ComponentNode.setVariableOrder":["setVariableOrder"],"EnumCase.remove":["removeEnumCase"],"EnumCase.setAttributes":["updateEnumCase"],"EnumVariable.addCase":["addEnumCase"],"EnumVariable.setCaseOrder":["setEnumCaseOrder"],createCollection:["createCollection"],createManagedCollection:["createManagedCollection"],[_t]:[],[qt]:[],[Yt]:[],[Xt]:[],[Zt]:[],[Jt]:[],[Pn]:["publish"],[Sn]:[],[Fn]:["deploy"],[Dn]:[],[vn]:[],[Nn]:["createManagedCollection"],[kn]:[],[En]:[],[Mn]:[],[An]:[],[wn]:["applyAgentChanges"],[Vn]:["startAgentConversation"],[Wn]:["continueAgentConversation"],[Ln]:["submitAgentClarification"]},Wt=[];for(let n of Object.keys(Bn))Bn[n].length!==0&&Wt.push(n);P(Wt);function Un(n){let e={};for(let t of Wt){let i=Bn[t];e[t]=i.every(o=>n[o]);}return e}r(Un,"createPerMethodPermissionMap");function pr(){let n={};for(let e of Wt)n[e]=true;return n}r(pr,"createPerMethodPermissionMapForTesting");var xe=null;function mr(n){if(typeof window>"u")return;if(!xe){let t=document.createElement("style");document.head.appendChild(t),xe=t.sheet;}if(!xe){n();return}let e=xe.insertRule("* { transition: none !important; animation: none !important; }");n(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{xe&&xe.deleteRule(e);});});}r(mr,"withDisabledCssTransitions");var tt=class{static{r(this,"PluginEngine");}methodInvocationId=0;notificationId=0;postMessage;methodResponseHandlers=new Map;mode;subscriptions=new Map;perMethodPermissionMap;permissionSubscriptions=new Set;messageTypesCheckedInIsAllowedTo=new Set;showUncheckedPermissionToasts=true;environmentInfo=null;initialState;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;rejectAllPending(e){for(let[t,i]of this.methodResponseHandlers)i.reject(e),this.methodResponseHandlers.delete(t);}constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=pr(),this.initialState={mode:"canvas",intent:"plugin/open"};return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof J&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof J&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.initialState=e.initialState??{mode:e.mode,intent:"plugin/open"},this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=Un(e.permissionMap),this.postMessage=(t,i)=>e.transport.send(t,i),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:Se(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,void 0,...t)}async invokeTransferable(e,t,...i){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:i.map(B)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let i=this.subscriptions.get(e)??new Set;return i.add(t),this.subscriptions.set(e,i),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=r(e=>{let t=e?.data??e;if(ur(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Un(t.permissionMap);for(let i of this.permissionSubscriptions)i();break}case "methodResponse":{let i=this.methodResponseHandlers.get(t.id);if(!i){switch(this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":throw new Error(`No handler for response with id ${t.id}`);case "api":{if(!(t.id<this.methodInvocationId))throw new Error(`No handler for unknown response id ${t.id}`);break}default:Se(this.mode);}break}this.methodResponseHandlers.delete(t.id),f(t.error)?i.reject(new et(t.error)):i.resolve(t.result);break}case "subscriptionMessage":{let{topic:i,payload:o}=t,a=this.subscriptions.get(i);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let i=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!i)throw new Error("Menu action received for an unknown menu item");i();break}default:Se(t);}},"onMessage");getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:Se(t);}}applyPluginTheme=r(e=>{mr(()=>{document.body.setAttribute("data-framer-theme",e.mode);for(let t in e.tokens)document.body.style.setProperty(t,e.tokens[t]);});},"applyPluginTheme");async cloneNode(e){let t=await this.invoke("cloneNode",e);return t?x(t,this):null}async cloneWebPage(e,t){let i=await this.invoke("cloneWebPage",e,t);c(i,"Expected to receive data for cloned web page");let o=x(i,this);return c(o instanceof K,"Expected cloned node to be an instance of WebPageNode"),o}async cloneDesignPage(e,t){let i=await this.invoke("cloneDesignPage",e,t);c(i,"Expected to receive data for cloned design page");let o=x(i,this);return c(o instanceof $,"Expected cloned node to be an instance of DesignPageNode"),o}async setAttributes(e,t){let i=await this.invoke("setAttributes",e,t);return i?x(i,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?x(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(i=>{let o=x(i,this);return c(Je(o)),o})}notify=r((e,t)=>{let i=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:i,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:r(()=>this.invoke("closeNotification",i),"close")}},"notify");async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=wt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let i=wt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",i,t);}};function la(n){return n.type==="component"}r(la,"isCodeFileComponentExport");function da(n){return n.type==="override"}r(da,"isCodeFileOverrideExport");var On=class{static{r(this,"CodeFileVersion");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get createdAt(){return this.#e.createdAt}get createdBy(){return this.#e.createdBy}constructor(e,t){this.#t=t,this.#e=e;}async getContent(){return await this.#t.invoke("getCodeFileVersionContent",this.#e.fileId,this.#e.id)}},Q=class n{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new n(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new n(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new On(t,this.#t))}async showProgressOnInstances(e){return this.#t.invoke("showProgressOnInstances",this.id,e)}async removeProgressFromInstances(){return this.#t.invoke("removeProgressFromInstances",this.id)}async lint(e){return Promise.resolve([])}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e,this.id)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Lt=class n{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new n(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let i=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!i)return null;let o=x(i,this.#t);return c(be(o)),o}};var ua=(()=>{let n=null;return {disableUntilMouseUp:r(()=>{if(n)return;n=document.createElement("style"),n.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(n);let e=r(()=>{n&&(document.head.removeChild(n),n=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),i=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",i);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",i);}r(o,"cleanup");},"disableUntilMouseUp")}})(),gr=5,ca=(()=>{let n=1;return {next:r(()=>`drag-${n++}`,"next")}})();function pa(){}r(pa,"noop");function fr(n,e,t,i){if(n.mode!=="canvas")return pa;let o=ca.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,u=se.subscribeToIsAllowedTo("makeDraggable",m=>{m||T();}),I=r(m=>{se.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&n.invoke("onDragEnd",{...m,dragSessionId:o}).then(h=>{try{i?.(h);}catch{}}).catch(h=>{if(h instanceof Error){i?.({status:"error",reason:h.message});return}if(typeof h=="string"){i?.({status:"error",reason:h});return}i?.({status:"error"});}),T());},"endDrag"),S=r(m=>{if(!se.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(m.buttons>0&&!!(m.buttons&1))){I({cancelled:false});return}let{clientX:A,clientY:z}=m;if(s.type==="pointerDown"){let E=A-s.dragStart.mouse.x,ut=z-s.dragStart.mouse.y;if(Math.abs(E)<gr&&Math.abs(ut)<gr)return;s={type:"dragging",dragStart:s.dragStart},n.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),ua.disableUntilMouseUp();}d.setPointerCapture(m.pointerId);let te={x:A,y:z};n.invoke("onDrag",{dragSessionId:o,mouse:te}).then(E=>{s.type==="dragging"&&(document.body.style.cursor=E??"");});},"handlePointerChange"),O=r(m=>{m.key==="Escape"&&I({cancelled:true});},"handleKeyDown"),_=r(()=>{I({cancelled:true});},"handleBlur"),b=r(m=>{if(!se.isAllowedTo("makeDraggable"))return;I({cancelled:true});let h=e.getBoundingClientRect(),A={x:h.x,y:h.y,width:h.width,height:h.height},z,te=e.querySelectorAll("svg");if(te.length===1){let ce=te.item(0).getBoundingClientRect();z={x:ce.x,y:ce.y,width:ce.width,height:ce.height};}let E={x:m.clientX,y:m.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:A,svgRect:z,mouse:E}},n.invoke("setDragData",o,t()),d.addEventListener("pointermove",S,true),d.addEventListener("pointerup",S,true),window.addEventListener("keydown",O,true),window.addEventListener("blur",_);},"handlePointerDown"),p=r(()=>{if(!se.isAllowedTo("makeDraggable"))return;let m=t();m.type==="detachedComponentLayers"&&n.invoke("preloadDetachedComponentLayers",m.url),m.type==="image"&&n.invoke("preloadImageUrlForInsertion",m.image),m.previewImage&&n.invoke("preloadDragPreviewImage",m.previewImage);},"preload");e.addEventListener("pointerdown",b),e.addEventListener("mouseenter",p);function T(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",S,true),d.removeEventListener("pointerup",S,true),window.removeEventListener("keydown",O,true),window.removeEventListener("blur",_);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",b),e.removeEventListener("mouseenter",p),I({cancelled:true}),u();}}r(fr,"makeDraggable");var Ce=class n{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[i]=await this.#t.invoke("addRedirects",[t]);return c(ct(i)),C(i)?null:new n(i,this.#t)}};var zn=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,i]=si(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,i(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new J}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let i=x(t,this.#e);return c(Je(i)),i})}async setSelection(e){let t=f(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let i=t.map(o=>{let a=x(o,this.#e);return c(Je(a)),a});e(i);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=x(e,this.#e);return c(Tn(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let i=x(t,this.#e);c(Tn(i)),e(i);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let i=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!i)return null;let o=x(i,this.#e);return c(o instanceof U),o}async removeNodes(e){return this.#e.invoke("removeNodes2",e)}async removeNode(e){return this.removeNodes([e])}async cloneNode(e){return this.#e.cloneNode(e)}async getNode(e){let t=await this.#e.invoke("getNode",e);return t?x(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let i=f(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",i,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,i){return this.#e.invoke("setParent",e,t,i)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(i=>x(i,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(i=>x(i,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(i=>x(i,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?y(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(y(this.#e,t));})}async addImage(e){let t=await Oe(e),i=Z(t);return this.#e.invokeTransferable("addImage",i,t)}async setImage(e){let t=await Oe(e),i=Z(t);return this.#e.invokeTransferable("setImage",i,t)}async uploadImage(e){let t=await Oe(e),i=Z(t),o=await this.#e.invokeTransferable("uploadImage",i,t);return y(this.#e,o)}async addImages(e){let t=await bn(e),i=t.flatMap(Z);await this.#e.invokeTransferable("addImages",i,t);}async uploadImages(e){let t=await bn(e),i=t.flatMap(Z),o=await this.#e.invokeTransferable("uploadImages",i,t);return y(this.#e,o)}async uploadFile(e){let t=await hn(e),i=await this.#e.invokeTransferable("uploadFile",Z(t),t);return y(this.#e,i)}async uploadFiles(e){let t=await Promise.all(e.map(hn)),i=t.flatMap(Z),o=await this.#e.invokeTransferable("uploadFiles",i,t);return y(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:i}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:i}),a=x(o,this.#e);return c(be(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:i}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:i}),a=x(o,this.#e);return c(Mt(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,i){return fr(this.#e,e,t,i)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return c(e,"Collection data must be defined"),new he(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return c(e,"Collections data must be defined"),e.map(t=>new he(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new ie(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new ie(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new ie(t,this.#e))}notify=r((e,t)=>this.#e.notify(e,t),"notify");async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return y(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?y(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return y(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let i=y(this.#e,t);return e(i)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return y(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?y(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return y(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let i=y(this.#e,t);return e(i)})}async getFont(e,t){let i=await this.#e.invoke("getFont",e,t);return i?y(this.#e,i):null}async getFonts(){let e=await this.#e.invoke("getFonts");return y(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(e){return this.#e.invoke("getLocalizationGroups",e)}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new Ce(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let i=t.map(o=>new Ce(o,this.#e));return e(i)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(i=>new Ce(i,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,i){let o=await this.#e.invoke("createCodeFile",e,t,i);return new Q(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let i of e)t.push(new Q(i,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new Q(t,this.#e):null}lintCode(e,t,i){return Promise.resolve([])}typecheckCode(e,t,i,o){return this.#e.invoke("typecheckCode",e,t,i,o)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let i=t?.map(o=>new Q(o,this.#e));return e(i)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let i=t?new Q(t,this.#e):null;return e(i)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),i=x(t,this.#e);return c(i instanceof $,"Expected node to be a DesignPageNode"),i}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),i=x(t,this.#e);return c(i instanceof K,"Expected node to be a WebPageNode"),i}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new ie(t,this.#e)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new he(t,this.#e)}async setCloseWarning(e){return this.#e.invoke("setCloseWarning",e)}get[l.initialState](){return this.#e.initialState}},Gn=class extends zn{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},nt=class extends Gn{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Lt(t,this.#e)}async[l.getAiServiceInfo](e){return this.#e.invoke(mt,e)}async[l.sendTrackingEvent](e,t,i){return this.#e.invoke(gt,e,t,i)}async[l.getCurrentUser](){return this.#e.invoke(ft)}async[l.getProjectInfo](){return this.#e.invoke(yt)}async[l.getHTMLForNode](e){return this.#e.invoke(me,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(ge,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let i=await this.#e.invoke("createNode","TextNode",t??null,e);if(!i)return null;let o=x(i,this.#e);return c(o instanceof oe),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let i=x(t,this.#e);return c(i instanceof ae),i}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new Qe(t,this.#e))}async createLocale(e){return this.#e.invoke("createLocale",e)}async getLocaleLanguages(){return this.#e.invoke("getLocaleLanguages")}async getLocaleRegions(e){return this.#e.invoke("getLocaleRegions",e)}async[v.publish](){return this.#e.invoke("publish")}async[v.getDeployments](){return this.#e.invoke("getDeployments")}async[v.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[v.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[v.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[v.createManagedCollection](e){return this.createManagedCollection(e)}[v.rejectAllPending](e){this.#e.rejectAllPending(e);}async[v.getAgentSystemPrompt](){return this.#e.invoke("getAgentSystemPrompt")}async[v.getAgentContext](e){return this.#e.invoke("getAgentContext",e)}async[v.readProjectForAgent](e,t){return this.#e.invoke("readProjectForAgent",e,t)}async[v.applyAgentChanges](e,t){return this.#e.invoke("applyAgentChanges",e,t)}async[v.startAgentConversation](e,t){return this.#e.invoke("startAgentConversation",e,t)}async[v.continueAgentConversation](e,t){return this.#e.invoke("continueAgentConversation",e,t)}async[v.submitAgentClarification](e){return this.#e.invoke("submitAgentClarification",e)}};var Kn=class{constructor(e){this.origin=e;}origin;static{r(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function ma(){return new Promise(n=>{function e({data:t,origin:i}){if(!cr(t))return;window.removeEventListener("message",e);let a={transport:new Kn(i),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:i,theme:t.theme??null,initialState:t.initialState};n(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(dr,"*");})}r(ma,"createBrowserContext");async function ga(){return typeof window>"u"||"Deno"in globalThis?null:ma()}r(ga,"bootstrap");var yr=await ga(),se=yr?new nt(new tt(yr)):new Proxy({},{get(n,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function hr(n){return new nt(new tt(n))}r(hr,"createFramerInstance");var br={};function ya(n){if(env)try{Object.assign(env,n);}catch{}Object.assign(br,n);}r(ya,"configure");function Ie(n,e){let t=br[n]??env[n];return t&&t.length>0?t:e}r(Ie,"getEnv");var xr=isWorkerd,jn=globalThis.WebSocket;async function Cr(n,e){let t=new URL(n.href);t.protocol=t.protocol==="wss:"?"https:":t.protocol==="ws:"?"http:":t.protocol;let o=(await fetch(t.href,{headers:{Upgrade:"websocket",...e}})).webSocket;if(!o)throw new Error("WebSocket upgrade failed - server did not accept");return o.accept(),o}r(Cr,"connectWebSocketCF");var Ir,Tr;try{Ir=await import('fs'),Tr=await import('path');}catch{}var Hn=Ir,_n=Tr;var le=(u=>(u.PROJECT_CLOSED="PROJECT_CLOSED",u.POOL_EXHAUSTED="POOL_EXHAUSTED",u.TIMEOUT="TIMEOUT",u.INTERNAL="INTERNAL",u.NODE_NOT_FOUND="NODE_NOT_FOUND",u.SCREENSHOT_TOO_LARGE="SCREENSHOT_TOO_LARGE",u.INVALID_REQUEST="INVALID_REQUEST",u.UNAUTHORIZED="UNAUTHORIZED",u))(le||{}),D=class extends Error{static{r(this,"FramerAPIError");}code;constructor(e,t){super(e),this.name="FramerAPIError",this.code=t,this.stack=void 0;}};function ha(n){return n instanceof D?n.code==="POOL_EXHAUSTED":false}r(ha,"isRetryableError");var ba=new Map(Object.values(le).map(n=>[n,n]));function Sr(n){return typeof n=="string"?ba.get(n)??"INTERNAL":"INTERNAL"}r(Sr,"parseErrorCode");var qn={silent:0,error:1,warn:2,info:3,debug:4};function xa(){let n=Ie("FRAMER_API_LOG_LEVEL")?.toLowerCase();return n&&n in qn?n:"warn"}r(xa,"getLogLevel");var Yn=xa();function it(n){return qn[n]<=qn[Yn]}r(it,"shouldLog");var rt=globalThis.console,Ca="\x1B[90m",Ia="\x1B[0m";function Ta(n){return n?`[FramerAPI:${n}]`:"[FramerAPI]"}r(Ta,"formatPrefix");function Pa(n,...e){return [Ca+n,...e,Ia]}r(Pa,"formatDebug");function Fr(n){let e=Ta(n);return {warn:r((...t)=>{it("warn")&&rt.warn(e,...t);},"warn"),error:r((...t)=>{it("error")&&rt.error(e,...t);},"error"),log:r((...t)=>{it("info")&&rt.log(e,...t);},"log"),info:r((...t)=>{it("info")&&rt.info(e,...t);},"info"),debug:r((...t)=>{it("debug")&&rt.debug(...Pa(e,...t));},"debug"),setLevel:r(t=>{Yn=t;},"setLevel"),getLevel:r(()=>Yn,"getLevel"),withRequestId:r(t=>Fr(t),"withRequestId")}}r(Fr,"createLogger");var k=Fr();k.warn;k.error;k.log;k.info;k.debug;k.setLevel;k.getLevel;var Rt="0.1.4-alpha.2";function ee(n,...e){if(n)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let i=t.stack.split(`
5
+ `));}catch{}throw t}r(c,"assert");function P(n){for(let e of Reflect.ownKeys(n)){let t=n[e];!t||typeof t!="object"&&!Qr(t)||P(t);}return Object.freeze(n)}r(P,"deepFreeze");function si(n){return [n.slice(0,-1),n.at(-1)]}r(si,"splitRestAndLast");var g="__class";var _t=Symbol(),qt=Symbol(),Yt=Symbol(),Xt=Symbol(),eo=Symbol(),to=Symbol(),no=Symbol(),io=Symbol(),ro=Symbol(),Zt=Symbol(),Jt=Symbol(),l={getAiServiceInfo:_t,sendTrackingEvent:qt,getCurrentUser:Yt,getProjectInfo:Xt,environmentInfo:eo,initialState:to,showUncheckedPermissionToasts:no,marshal:io,unmarshal:ro,getHTMLForNode:Zt,setHTMLForNode:Jt},pe="INTERNAL_",mt=`${pe}getAiServiceInfo`,gt=`${pe}sendTrackingEvent`,ft=`${pe}getCurrentUser`,yt=`${pe}getProjectInfo`,me=`${pe}getHTMLForNode`,ge=`${pe}setHTMLForNode`;var M=class{static{r(this,"VariableBase");}#e;#t;get nodeId(){return this.#t.nodeId}get nodeType(){return this.#t.nodeType}get id(){return this.#t.id}get name(){return this.#t.name}get description(){return this.#t.description??null}constructor(e,t){this.#e=e,this.#t=t;}async setAttributes(e){let t=await this.#e.invoke("updateVariable",this.nodeId,this.id,{...e,type:this.type});if(C(t))return null;let i=this.constructor;return new i(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},w="Variable";function V(n){let e=n.at(0);return c(!oi(e)),`${e.toLowerCase()}${n.slice(1,-w.length)}`}r(V,"classToType");var oo=`Boolean${w}`,ao=V(oo),Fe=class n extends M{static{r(this,"BooleanVariable");}type=ao;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},so=`Number${w}`,lo=V(so),De=class n extends M{static{r(this,"NumberVariable");}type=lo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},uo=`String${w}`,co=V(uo),ve=class n extends M{static{r(this,"StringVariable");}type=co;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},po=`FormattedText${w}`,mo=V(po),Ne=class n extends M{static{r(this,"FormattedTextVariable");}type=mo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},go=`Enum${w}`,fo=V(go),Y=class n{static{r(this,"EnumCase");}#e;#t;#n;#i;get id(){return this.#i.id}get name(){return this.#i.name}get nameByLocale(){return this.#i.nameByLocale}constructor(e,t,i,o){this.#e=e,this.#t=t,this.#n=i,this.#i=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#n,this.id,e);return t?new n(this.#e,this.#t,this.#n,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#n,this.id);}},ke=class n extends M{static{r(this,"EnumVariable");}type=fo;#e;#t;#n;get cases(){return this.#n||(this.#n=P(this.#t.cases.map(e=>new Y(this.#e,this.nodeId,this.id,e)))),this.#n}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new Y(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},yo=`Color${w}`,ho=V(yo),Ee=class n extends M{static{r(this,"ColorVariable");}type=ho;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},bo=`Image${w}`,xo=V(bo),Me=class n extends M{static{r(this,"ImageVariable");}type=xo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Co=`File${w}`,Io=V(Co),Ae=class n extends M{static{r(this,"FileVariable");}type=Io;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},To=`Link${w}`,Po=V(To),we=class n extends M{static{r(this,"LinkVariable");}type=Po;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},So=`Date${w}`,Fo=V(So),Ve=class n extends M{static{r(this,"DateVariable");}type=Fo;#e;get displayTime(){return this.#e.displayTime}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Do=`Border${w}`,vo=V(Do),We=class n extends M{static{r(this,"BorderVariable");}type=vo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},No=`Unsupported${w}`,ko=V(No),Le=class n extends M{static{r(this,"UnsupportedVariable");}type=ko;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}};function li(n){return n instanceof M}r(li,"isVariable");function Eo(n){return li(n)&&n.nodeType==="component"}r(Eo,"isComponentVariable");var R=class{static{r(this,"FieldBase");}#e;#t;#n;get id(){return this.#n.id}get name(){return this.#n.name}constructor(e,t,i){this.#e=e,this.#t=t,this.#n=i;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[i]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(c(ct(i)),C(i))return null;c(i.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,i)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},L=class extends R{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,i){super(e,t,i),this.#e=i;}},ht=class extends R{static{r(this,"BooleanField");}type=tn},bt=class extends R{static{r(this,"ColorField");}type=nn},xt=class extends R{static{r(this,"NumberField");}type=rn},Ct=class extends L{static{r(this,"StringField");}type=on;#e;constructor(e,t,i){super(e,t,i),this.#e=i;}get basedOn(){return this.#e.basedOn}},It=class extends L{static{r(this,"FormattedTextField");}type=an},Re=class extends L{static{r(this,"ImageField");}type=sn},Tt=class extends L{static{r(this,"LinkField");}type=dn},Pt=class extends L{static{r(this,"DateField");}type=un;#e;get displayTime(){return this.#e.displayTime}constructor(e,t,i){super(e,t,i),this.#e=i;}},St=class extends R{static{r(this,"FieldDivider");}type=fn},Be=class extends R{static{r(this,"UnsupportedField");}type=yn},Ft=class extends L{static{r(this,"FileField");}type=cn;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,i){super(e,t,i),this.#e=i;}},Dt=class extends R{static{r(this,"EnumField");}type=pn;#e;#t;#n;#i;get cases(){return this.#i||(this.#i=this.#n.cases.map(e=>new Y(this.#e,this.#t,this.id,e)),P(this.#i)),this.#i}constructor(e,t,i){super(e,t,i),this.#e=e,this.#t=t,this.#n=i;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new Y(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},vt=class extends L{static{r(this,"CollectionReferenceField");}type=mn;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},Nt=class extends L{static{r(this,"MultiCollectionReferenceField");}type=gn;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},Qt=class extends L{static{r(this,"ArrayField");}type=ln;fields;constructor(e,t,i){super(e,t,i);let o=i.fields[0];this.fields=[new Re(e,t,o)];}};function en(n,e,t){return n.map(i=>{switch(i.type){case tn:return new ht(e,t,i);case nn:return new bt(e,t,i);case rn:return new xt(e,t,i);case on:return new Ct(e,t,i);case an:return new It(e,t,i);case sn:return new Re(e,t,i);case dn:return new Tt(e,t,i);case un:return new Pt(e,t,i);case fn:return new St(e,t,i);case yn:return new Be(e,t,i);case cn:return new Ft(e,t,i);case pn:return new Dt(e,t,i);case mn:return new vt(e,t,i);case gn:return new Nt(e,t,i);case ln:return new Qt(e,t,i);default:return new Be(e,t,i)}})}r(en,"fieldDefinitionDataArrayToFieldClassInstances");function Mo(n){return n instanceof R}r(Mo,"isField");var di="action";function Ao(n){return !!n&&di in n&&f(n[di])}r(Ao,"isLocalizedValueUpdate");function ui(n){return Object.keys(n).reduce((e,t)=>{let i=n[t];return Ao(i)&&(e[t]=i),e},{})}r(ui,"filterInlineLocalizationValues");var Ue=class n{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new n(t)}[l.marshal](){return {[g]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function wo(n){return n instanceof Ue}r(wo,"isFileAsset");var Vo="ImageAsset";function ci(n){return N(n)?n[g]===Vo:false}r(ci,"isImageAssetData");var X=class n{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return {[g]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new n(this.#t,{[g]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return Ro(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),i=new Blob([t],{type:e});return createImageBitmap(i)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((i,o)=>{let a=new Image;a.onload=()=>i(a),a.onerror=()=>o(),a.src=t;})}};function Wo(n){return n instanceof X}r(Wo,"isImageAsset");function Z(n){return n.type==="bytes"?[n.bytes.buffer]:[]}r(Z,"getTransferable");function Lo(n){if(!N(n))return false;let e="bytes",t="mimeType";return !(!(e in n)||!(t in n)||!(n[e]instanceof Uint8Array)||!f(n[t]))}r(Lo,"isBytesData");async function Oe(n){if(n instanceof File)return xn(n);let e=await pi(n.image);return {name:n.name,altText:n.altText,resolution:n.resolution,preferredImageRendering:n.preferredImageRendering,...e}}r(Oe,"createImageTransferFromInput");async function hn(n){if(n instanceof File)return xn(n);let e=await pi(n.file);return {name:n.name,...e}}r(hn,"createFileTransferFromInput");async function pi(n){return n instanceof File?xn(n):Lo(n)?{type:"bytes",mimeType:n.mimeType,bytes:n.bytes}:{type:"url",url:n}}r(pi,"createAssetTransferFromAssetInput");function bn(n){return Promise.all(n.map(Oe))}r(bn,"createNamedAssetDataTransferFromInput");async function xn(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=o=>{let a=n.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:n.name});},i.onerror=o=>{t(o);},i.readAsArrayBuffer(n);})}r(xn,"getAssetDataFromFile");async function Ro(n){let e=n instanceof File,t=e?URL.createObjectURL(n):n,i=new Image;return i.crossOrigin="anonymous",new Promise((o,a)=>{i.onload=()=>{o({width:i.naturalWidth,height:i.naturalHeight});},i.onerror=s=>{a(s);},i.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(Ro,"measureImage");var kt=class{static{r(this,"ComputedValueBase");}};var Bo="unsupported",ze=class n extends kt{static{r(this,"UnsupportedComputedValue");}type=Bo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new n(t)}[l.marshal](){return this.#e}};function Uo(n){return n instanceof kt}r(Uo,"isComputedValue");var Oo="Font";function gi(n){return N(n)&&n[g]===Oo}r(gi,"isFontData");function zo(n){if(!q(n))return false;switch(n){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(zo,"isFontWeight");function Go(n){if(!f(n))return false;switch(n){case "normal":case "italic":return true;default:return false}}r(Go,"isFontStyle");function fi(n){return N(n)?f(n.family)&&f(n.selector)&&zo(n.weight)&&Go(n.style):false}r(fi,"isFont");var G=class n{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let i=mi.get(t.selector);if(i)return i;let o=new n(t);return mi.set(t.selector,o),o}[l.marshal](){return {[g]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},mi=new Map;var Ko="LinearGradient",$o="RadialGradient",jo="ConicGradient",fe=class{static{r(this,"GradientBase");}#e;get stops(){return this.#e.stops}constructor(e){this.#e=e;}cloneWithAttributes(e){let t=this.constructor;return new t({...this.#e,...e})}},Ge=class n extends fe{static{r(this,"LinearGradient");}[g]=Ko;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:y(e,t.stops)})}[l.marshal](){return B({...this.#e,[g]:this[g]})}toCSS(){let e=this.#e.stops.map(t=>(c(f(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Ke=class n extends fe{static{r(this,"RadialGradient");}[g]=$o;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:y(e,t.stops)})}[l.marshal](){return B({...this.#e,[g]:this[g]})}toCSS(){let e=this.stops.map((t,i)=>{c(f(t.color),"ColorStyle not supported yet");let o=this.stops[i+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},$e=class n extends fe{static{r(this,"ConicGradient");}[g]=jo;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:y(e,t.stops)})}[l.marshal](){return B({...this.#e,[g]:this[g]})}toCSS(){let e=this.stops.map(t=>(c(f(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function yi(n){return n instanceof fe}r(yi,"isGradient");var Ho="ColorStyle";function Et(n){return N(n)?n[g]===Ho:false}r(Et,"isColorStyleData");var ne=class n{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return {[g]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new n(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function ye(n){return n instanceof ne}r(ye,"isColorStyle");var _o="TextStyle";function hi(n){return N(n)?n[g]===_o:false}r(hi,"isTextStyleData");var je=class n{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=G[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&G[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&G[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&G[l.unmarshal](e,t.boldItalicFont),this.color=Et(t.color)?ne[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Et(t.decorationColor)?ne[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return {[g]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:ye(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:ye(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new n(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function Cn(n){return n instanceof je}r(Cn,"isTextStyle");function qo(n){return N(n)&&l.marshal in n}r(qo,"isSelfMarshalable");function B(n){if(qo(n))return n[l.marshal]();if(Ht(n))return n.map(B);if(pt(n)){let e={};for(let t of Object.keys(n))e[t]=B(n[t]);return e}return n}r(B,"marshal");var bi={ColorStyle:ne,ConicGradient:$e,FileAsset:Ue,Font:G,ImageAsset:X,LinearGradient:Ge,RadialGradient:Ke,TextStyle:je,BooleanVariable:Fe,BorderVariable:We,ColorVariable:Ee,DateVariable:Ve,EnumVariable:ke,FileVariable:Ae,FormattedTextVariable:Ne,ImageVariable:Me,LinkVariable:we,NumberVariable:De,StringVariable:ve,UnsupportedVariable:Le,UnsupportedComputedValue:ze};function Yo(n){return pt(n)&&f(n[g])&&n[g]in bi}r(Yo,"isSelfUnmarshalable");function y(n,e){if(Yo(e))return bi[e[g]][l.unmarshal](n,e);if(Ht(e))return e.map(t=>y(n,t));if(pt(e)){let t={};for(let i of Object.keys(e))t[i]=y(n,e[i]);return t}return e}r(y,"unmarshal");var Xo={array:false,boolean:false,collectionReference:false,color:false,date:false,enum:false,file:false,formattedText:false,image:true,link:false,multiCollectionReference:false,number:false,string:false,unsupported:false};function Zo(n){return Xo[n]}r(Zo,"isSupportedArrayItemFieldType");function Jo(n){return Zo(n.type)}r(Jo,"isSupportedArrayItemFieldDataEntry");var tn="boolean",nn="color",rn="number",on="string",an="formattedText",sn="image",ln="array",dn="link",un="date",cn="file",pn="enum",mn="collectionReference",gn="multiCollectionReference",fn="divider",yn="unsupported";function Qo(n){return n.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(i=>{let o=i.nameByLocale?ui(i.nameByLocale):void 0;return {...i,nameByLocale:o}});return {...e,cases:t}})}r(Qo,"sanitizeEnumFieldForMessage");function xi(n,e){let t={};for(let i in n){let o=n[i];if(!o)continue;if(o.type!=="array"){t[i]=y(e,o);continue}let a=o.value.map(s=>{let d=xi(s.fieldData,e),u={};for(let I in d){let S=d[I];c(S&&Jo(S),"Unsupported array item field data entry"),u[I]=S;}return {...s,fieldData:u}});t[i]={...o,value:a};}return t}r(xi,"deserializeFieldData");var he=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,c(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,P(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=Qo(e);return this.#e.invoke("setManagedCollectionFields",this.id,t)}async addItems(e){return this.#e.invoke("addManagedCollectionItems2",this.id,e)}async removeItems(e){return this.#e.invoke("removeManagedCollectionItems",this.id,e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},ie=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,P(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return en(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return c(t.every(ai)),en(t,this.#e,this.id)}async removeFields(e){return this.#e.invoke("removeCollectionFields",this.id,e)}async setFieldOrder(e){return this.#e.invoke("setCollectionFieldOrder",this.id,e)}async getItems(){return (await this.#e.invoke("getCollectionItems2",this.id)).map(t=>new He(t,this.#e))}async addItems(e){await this.#e.invoke("addCollectionItems2",this.id,e);}async removeItems(e){return this.#e.invoke("removeCollectionItems",e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},He=class n{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let i=xi(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=i,this.#e=t,P(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new n(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var ea={fixed:true,sticky:true,absolute:true,relative:true},Ci="position";function il(n){if(!(Ci in n))return false;let e=n[Ci];return f(e)&&ea[e]===true}r(il,"supportsPosition");var Ii="top";function rl(n){if(!(Ii in n))return false;let e=n[Ii];return f(e)||C(e)}r(rl,"supportsPins");var Ti="width";function ol(n){if(!(Ti in n))return false;let e=n[Ti];return f(e)||C(e)}r(ol,"supportsSize");var Pi="maxWidth";function al(n){if(!(Pi in n))return false;let e=n[Pi];return f(e)||C(e)}r(al,"supportsSizeConstraints");var Si="aspectRatio";function sl(n){if(!(Si in n))return false;let e=n[Si];return q(e)||C(e)}r(sl,"supportsAspectRatio");var Fi="name";function ll(n){if(!(Fi in n))return false;let e=n[Fi];return f(e)||C(e)}r(ll,"supportsName");var Di="visible";function dl(n){if(!(Di in n))return false;let e=n[Di];return Pe(e)}r(dl,"supportsVisible");var vi="locked";function ul(n){if(!(vi in n))return false;let e=n[vi];return Pe(e)}r(ul,"supportsLocked");var Ni="backgroundColor";function cl(n){if(!(Ni in n))return false;let e=n[Ni];return f(e)||ye(e)||C(e)}r(cl,"supportsBackgroundColor");var ki="backgroundColor";function pl(n){if(!(ki in n))return false;let e=n[ki];return f(e)||Et(e)||C(e)}r(pl,"supportsBackgroundColorData");var Ei="backgroundImage";function ml(n){if(!(Ei in n))return false;let e=n[Ei];return e instanceof X||C(e)}r(ml,"supportsBackgroundImage");var Mi="backgroundImage";function gl(n){if(!(Mi in n))return false;let e=n[Mi];return e instanceof X?false:ci(e)||C(e)}r(gl,"supportsBackgroundImageData");var Ai="backgroundGradient";function fl(n){if(!(Ai in n))return false;let e=n[Ai];return yi(e)||C(e)}r(fl,"supportsBackgroundGradient");var wi="backgroundGradient";function yl(n){if(!(wi in n))return false;let e=n[wi];return N(e)||C(e)}r(yl,"supportsBackgroundGradientData");var Vi="rotation";function hl(n){if(!(Vi in n))return false;let e=n[Vi];return q(e)}r(hl,"supportsRotation");var Wi="opacity";function bl(n){if(!(Wi in n))return false;let e=n[Wi];return q(e)}r(bl,"supportsOpacity");var Li="borderRadius";function xl(n){if(!(Li in n))return false;let e=n[Li];return f(e)||C(e)}r(xl,"supportsBorderRadius");var Ri="border";function Cl(n){if(!(Ri in n))return false;let e=n[Ri];return C(e)||ye(e.color)}r(Cl,"supportsBorder");var Bi="svg";function Il(n){if(!(Bi in n))return false;let e=n[Bi];return f(e)}r(Il,"supportsSVG");var Ui="textTruncation";function Tl(n){if(!(Ui in n))return false;let e=n[Ui];return q(e)||C(e)}r(Tl,"supportsTextTruncation");var Oi="zIndex";function Pl(n){if(!(Oi in n))return false;let e=n[Oi];return q(e)||C(e)}r(Pl,"supportsZIndex");var zi="overflow";function Sl(n){if(!(zi in n))return false;let e=n[zi];return f(e)||C(e)}r(Sl,"supportsOverflow");var Gi="componentIdentifier";function Fl(n){if(!(Gi in n))return false;let e=n[Gi];return f(e)}r(Fl,"supportsComponentInfo");var Ki="font";function Dl(n){if(!(Ki in n))return false;let e=n[Ki];return fi(e)}r(Dl,"supportsFont");var $i="font";function vl(n){if(!($i in n))return false;let e=n[$i];return gi(e)||C(e)}r(vl,"supportsFontData");var ji="inlineTextStyle";function Nl(n){if(!(ji in n))return false;let e=n[ji];return Cn(e)||C(e)}r(Nl,"supportsInlineTextStyle");var Hi="inlineTextStyle";function kl(n){if(!(Hi in n))return false;let e=n[Hi];return hi(e)||C(e)}r(kl,"supportsInlineTextStyleData");var _i="link";function El(n){if(!(_i in n))return false;let e=n[_i];return f(e)||C(e)}r(El,"supportsLink");var qi="imageRendering";function Ml(n){if(!(qi in n))return false;let e=n[qi];return f(e)||C(e)}r(Ml,"supportsImageRendering");var Yi="layout";function Ji(n){if(!(Yi in n))return false;let e=n[Yi];return f(e)||C(e)}r(Ji,"supportsLayout");function Al(n){return Ji(n)?n.layout==="stack":false}r(Al,"hasStackLayout");function wl(n){return Ji(n)?n.layout==="grid":false}r(wl,"hasGridLayout");var Xi="isVariant";function Qi(n){if(!(Xi in n))return false;let e=n[Xi];return Pe(e)}r(Qi,"supportsComponentVariant");function In(n){return Qi(n)?n.isVariant:false}r(In,"isComponentVariant");function er(n){return !Qi(n)||!In(n)?false:!C(n.gesture)}r(er,"isComponentGestureVariant");var Zi="isBreakpoint";function ta(n){if(!(Zi in n))return false;let e=n[Zi];return Pe(e)}r(ta,"supportsBreakpoint");function tr(n){return ta(n)?n.isBreakpoint:false}r(tr,"isBreakpoint");var W=class{static{r(this,"NodeMethods");}id;originalId;#e;constructor(e,t){this.id=e.id,this.originalId=e.originalId??null,this.#e=t;}get isReplica(){return this.originalId!==null}async remove(){return this.#e.invoke("removeNodes2",[this.id])}async select(){return this.#e.invoke("setSelection",[this.id])}async clone(){return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[g]==="UnknownNode")throw Error("Can not set attributes on unknown node");return this.#e.setAttributes(this.id,e)}async getRect(){return this.#e.invoke("getRect",this.id)}async zoomIntoView(e){return this.#e.invoke("zoomIntoView",[this.id],e)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}async getParent(){return this.#e.getParent(this.id)}async getChildren(){return re(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return re(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(i=>x(i,this.#e))}async getNodesWithAttribute(e){return re(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(i=>x(i,this.#e))}async getNodesWithAttributeSet(e){return re(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(i=>x(i,this.#e))}async*walk(){if(yield this,!re(this))for(let e of await this.getChildren())yield*e.walk();}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}},U=class extends W{static{r(this,"FrameNode");}[g]="FrameNode";name;visible;locked;backgroundColor;backgroundImage;backgroundGradient;rotation;opacity;borderRadius;border;imageRendering;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;zIndex;link;linkOpenInNewTab;linkSmoothScroll;linkClickTrackingId;linkRelValues;linkPreserveParams;overflow;overflowX;overflowY;layout;gap;padding;stackDirection;stackDistribution;stackAlignment;stackWrapEnabled;gridColumnCount;gridRowCount;gridAlignment;gridColumnWidthType;gridColumnWidth;gridColumnMinWidth;gridRowHeightType;gridRowHeight;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;isVariant;isPrimaryVariant;isBreakpoint;isPrimaryBreakpoint;inheritsFromId;gesture;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.backgroundColor=y(t,e.backgroundColor)??null,this.backgroundImage=y(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=y(t,e.border)??null,this.backgroundGradient=y(t,e.backgroundGradient)??null,this.imageRendering=e.imageRendering??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,this.zIndex=e.zIndex??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.linkSmoothScroll=e.linkSmoothScroll??null,this.linkClickTrackingId=e.linkClickTrackingId??null,this.linkRelValues=e.linkRelValues??null,this.linkPreserveParams=e.linkPreserveParams??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.layout=e.layout??null,this.gap=e.gap??null,this.padding=e.padding??null,this.stackDirection=e.stackDirection??null,this.stackDistribution=e.stackDistribution??null,this.stackAlignment=e.stackAlignment??null,this.stackWrapEnabled=e.stackWrapEnabled??null,this.gridColumnCount=e.gridColumnCount??null,this.gridRowCount=e.gridRowCount??null,this.gridAlignment=e.gridAlignment??null,this.gridColumnWidthType=e.gridColumnWidthType??null,this.gridColumnWidth=e.gridColumnWidth??null,this.gridColumnMinWidth=e.gridColumnMinWidth??null,this.gridRowHeightType=e.gridRowHeightType??null,this.gridRowHeight=e.gridRowHeight??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,this.inheritsFromId=e.inheritsFromId??null,this.gesture=e.gesture??null,this.isVariant=e.isVariant??false,this.isPrimaryVariant=e.isPrimaryVariant??false,this.isBreakpoint=e.isBreakpoint??false,this.isPrimaryBreakpoint=e.isPrimaryBreakpoint??false,P(this);}},oe=class extends W{static{r(this,"TextNode");}[g]="TextNode";name;visible;locked;rotation;opacity;zIndex;font;inlineTextStyle;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;link;linkOpenInNewTab;linkSmoothScroll;linkClickTrackingId;linkRelValues;linkPreserveParams;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;overflow;overflowX;overflowY;textTruncation;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.zIndex=e.zIndex??null,this.font=y(t,e.font)??null,this.inlineTextStyle=y(t,e.inlineTextStyle)??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.linkSmoothScroll=e.linkSmoothScroll??null,this.linkClickTrackingId=e.linkClickTrackingId??null,this.linkRelValues=e.linkRelValues??null,this.linkPreserveParams=e.linkPreserveParams??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.textTruncation=e.textTruncation??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,P(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(ge,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(me,this.id)}},_e=class extends W{static{r(this,"SVGNode");}[g]="SVGNode";name;visible;locked;svg;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.svg=e.svg,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,P(this);}},qe=class extends W{static{r(this,"VectorSetItemNode");}[g]="VectorSetItemNode";name;visible;locked;top;right;bottom;left;centerX;centerY;width;height;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.top=e.top??null,this.right=e.right??null,this.bottom=e.bottom??null,this.left=e.left??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,P(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ye=class extends W{static{r(this,"ComponentInstanceNode");}[g]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#n;get typedControls(){return this.#n||(this.#n=y(this.#e,this.#t.typedControls)??{}),this.#n}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=y(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,P(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},K=class extends W{static{r(this,"WebPageNode");}[g]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,P(this);}async clone(e){return this.#e.cloneWebPage(this.id,e)}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let i=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=x(i,this.#e);return c(o instanceof U),c(tr(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new He(e,this.#e):null}},ae=class extends W{static{r(this,"ComponentNode");}[g]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,P(this);}async addVariant(e,t){let i=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!i)throw new Error("Failed to add variant to component");let o=x(i,this.#e);return c(o instanceof U),c(In(o),"Node is not a component variant"),o}async addGestureVariant(e,t,i){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,i);if(!o)throw new Error("Failed to add state to component");let a=x(o,this.#e);return c(a instanceof U),c(er(a),"Node is not a gesture variant"),a}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return y(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,B(e));return y(this.#e,t)}async removeVariables(e){await this.#e.invoke("removeVariables",this.id,e);}async setVariableOrder(e){await this.#e.invoke("setVariableOrder",this.id,e);}},Xe=class extends W{static{r(this,"VectorSetNode");}[g]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,P(this);}},$=class extends W{static{r(this,"DesignPageNode");}[g]="DesignPageNode";name;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,P(this);}async clone(e){return this.#e.cloneDesignPage(this.id,e)}},Ze=class extends W{static{r(this,"UnknownNode");}[g]="UnknownNode";constructor(e,t){super(e,t),P(this);}async clone(){throw new Error("Cannot clone an unknown node")}};function x(n,e){switch(n[g]){case "DesignPageNode":return new $(n,e);case "WebPageNode":return new K(n,e);case "ComponentNode":return new ae(n,e);case "VectorSetNode":return new Xe(n,e);case "VectorSetItemNode":return new qe(n,e);case "ComponentInstanceNode":return new Ye(n,e);case "FrameNode":return new U(n,e);case "SVGNode":return new _e(n,e);case "TextNode":return new oe(n,e);case "UnknownNode":return new Ze(n,e);default:return new Ze(n,e)}}r(x,"convertRawNodeDataToNode");function Mt(n){return n instanceof U}r(Mt,"isFrameNode");function nr(n){return n instanceof oe}r(nr,"isTextNode");function ir(n){return n instanceof _e}r(ir,"isSVGNode");function be(n){return n instanceof Ye}r(be,"isComponentInstanceNode");function rr(n){return n instanceof K}r(rr,"isWebPageNode");function or(n){return n instanceof ae}r(or,"isComponentNode");function ar(n){return n instanceof $}r(ar,"isDesignPageNode");function sr(n){return n instanceof Xe}r(sr,"isVectorSetNode");function lr(n){return n instanceof qe}r(lr,"isVectorSetItemNode");function re(n){return n instanceof Ze}r(re,"isUnknownNode");function Je(n){return !!(Mt(n)||nr(n)||be(n)||ir(n)||lr(n)||re(n))}r(Je,"isCanvasNode");function Tn(n){return !!(rr(n)||ar(n)||or(n)||sr(n)||re(n))}r(Tn,"isCanvasRootNode");var Qe=class{static{r(this,"VectorSet");}id;name;owner;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.owner=e.owner,this.#e=t;}async getItems(){return (await this.#e.invoke("getVectorSetItems",this.id)).map(t=>new At(t,this.#e))}},At=class{static{r(this,"VectorSetItem");}id;name;insertUrl;iconUrl;#e;#t;constructor(e,t){this.id=e.id,this.name=e.name,this.insertUrl=e.insertUrl,this.iconUrl=e.iconUrl,this.#e=e.moduleId,this.#t=t;}async getVariables(){return this.#t.invoke("getVectorSetItemVariables",this.id,this.#e)}};var et=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},J=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function na(n){return n.type==="separator"}r(na,"isSeparatorMenuItem");function wt(n,e){let t=[];for(let i of n){if(na(i)){t.push(i);continue}let{onAction:o,...a}=i,s=a;if(i.onAction){let d=Math.random();e.set(d,i.onAction),s.actionId=d;}i.submenu&&(s.submenu=wt(i.submenu,e)),t.push(s);}return t}r(wt,"addMenuItemsToOnActionCallbackMap");var Vt="type",dr={[Vt]:"pluginReadySignal"},ra="pluginReadyResponse";var oa={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function ur(n){return N(n)&&f(n[Vt])&&n[Vt]in oa}r(ur,"isVekterToPluginNonHandshakeMessage");function cr(n){return N(n)&&n[Vt]===ra}r(cr,"isPluginReadyResponse");var Pn=Symbol(),Sn=Symbol(),Fn=Symbol(),Dn=Symbol(),vn=Symbol(),Nn=Symbol(),kn=Symbol(),En=Symbol(),Mn=Symbol(),An=Symbol(),wn=Symbol(),Vn=Symbol(),Wn=Symbol(),Ln=Symbol(),v={publish:Pn,getDeployments:Sn,deploy:Fn,getChangedPaths:Dn,getChangeContributors:vn,createManagedCollection:Nn,rejectAllPending:kn,readProjectForAgent:En,getAgentSystemPrompt:Mn,getAgentContext:An,applyAgentChanges:wn,startAgentConversation:Vn,continueAgentConversation:Wn,submitAgentClarification:Ln};function Rn(n){return typeof n=="string"&&n in v}r(Rn,"isFramerApiOnlyMethod");var aa=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions","lintCode"],sa=["closeNotification","closePlugin","setCloseWarning","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocaleLanguages","getLocaleRegions","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","typecheckCode","getCodeFileVersions","getCodeFiles","getCodeFile","getRedirects","uploadFile","uploadFiles","uploadImage","uploadImages","zoomIntoView","navigateTo","getRuntimeErrorForModule","getRuntimeErrorForCodeComponentNode","showProgressOnInstances","removeProgressFromInstances","addComponentInstancePlaceholder","updateComponentInstancePlaceholder","removeComponentInstancePlaceholder","setMenu","showContextMenu","getBreakpointSuggestionsForWebPage","getActiveCollectionItemForWebPage","getVariables","getVectorSets","getVectorSetItems","getVectorSetItemVariables","getChangedPaths","getChangeContributors","getDeployments","readProjectForAgent","getAgentSystemPrompt","getAgentContext",mt,gt,ft,yt,me,"getAiServiceInfo","sendTrackingEvent",...aa];new Set(sa);var Bn={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],setCloseWarning:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],createLocale:["createLocale"],getLocaleLanguages:[],getLocaleRegions:[],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields2"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields2"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode","cloneWebPage","cloneDesignPage"],"WebPageNode.clone":["cloneWebPage"],"DesignPageNode.clone":["cloneDesignPage"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[ge],"TextNode.getHTML":[],"ComponentNode.addVariant":["addVariantToComponent"],"ComponentNode.addGestureVariant":["addGestureVariantToComponent"],"ComponentNode.getVariables":[],"ComponentNode.addVariables":["addVariables"],"ComponentNode.removeVariables":["removeVariables"],"WebPageNode.getBreakpointSuggestions":[],"WebPageNode.addBreakpoint":["addBreakpointToWebPage"],"WebPageNode.getActiveCollectionItem":[],"ColorStyle.getPluginData":[],"ColorStyle.getPluginDataKeys":[],"ColorStyle.remove":["removeColorStyle"],"ColorStyle.setAttributes":["setColorStyleAttributes"],"ColorStyle.setPluginData":["setPluginDataForNode"],"TextStyle.getPluginData":[],"TextStyle.getPluginDataKeys":[],"TextStyle.remove":["removeTextStyle"],"TextStyle.setAttributes":["setTextStyleAttributes"],"TextStyle.setPluginData":["setPluginDataForNode"],"Variable.setAttributes":["updateVariable"],"Variable.remove":["removeVariables"],"ComponentNode.setVariableOrder":["setVariableOrder"],"EnumCase.remove":["removeEnumCase"],"EnumCase.setAttributes":["updateEnumCase"],"EnumVariable.addCase":["addEnumCase"],"EnumVariable.setCaseOrder":["setEnumCaseOrder"],createCollection:["createCollection"],createManagedCollection:["createManagedCollection"],[_t]:[],[qt]:[],[Yt]:[],[Xt]:[],[Zt]:[],[Jt]:[],[Pn]:["publish"],[Sn]:[],[Fn]:["deploy"],[Dn]:[],[vn]:[],[Nn]:["createManagedCollection"],[kn]:[],[En]:[],[Mn]:[],[An]:[],[wn]:["applyAgentChanges"],[Vn]:["startAgentConversation"],[Wn]:["continueAgentConversation"],[Ln]:["submitAgentClarification"]},Wt=[];for(let n of Object.keys(Bn))Bn[n].length!==0&&Wt.push(n);P(Wt);function Un(n){let e={};for(let t of Wt){let i=Bn[t];e[t]=i.every(o=>n[o]);}return e}r(Un,"createPerMethodPermissionMap");function pr(){let n={};for(let e of Wt)n[e]=true;return n}r(pr,"createPerMethodPermissionMapForTesting");var xe=null;function mr(n){if(typeof window>"u")return;if(!xe){let t=document.createElement("style");document.head.appendChild(t),xe=t.sheet;}if(!xe){n();return}let e=xe.insertRule("* { transition: none !important; animation: none !important; }");n(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{xe&&xe.deleteRule(e);});});}r(mr,"withDisabledCssTransitions");var tt=class{static{r(this,"PluginEngine");}methodInvocationId=0;notificationId=0;postMessage;methodResponseHandlers=new Map;mode;subscriptions=new Map;perMethodPermissionMap;permissionSubscriptions=new Set;messageTypesCheckedInIsAllowedTo=new Set;showUncheckedPermissionToasts=true;environmentInfo=null;initialState;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;rejectAllPending(e){for(let[t,i]of this.methodResponseHandlers)i.reject(e),this.methodResponseHandlers.delete(t);}constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=pr(),this.initialState={mode:"canvas",intent:"plugin/open"};return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof J&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof J&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.initialState=e.initialState??{mode:e.mode,intent:"plugin/open"},this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=Un(e.permissionMap),this.postMessage=(t,i)=>e.transport.send(t,i),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:Se(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,void 0,...t)}async invokeTransferable(e,t,...i){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:i.map(B)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let i=this.subscriptions.get(e)??new Set;return i.add(t),this.subscriptions.set(e,i),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=r(e=>{let t=e?.data??e;if(ur(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Un(t.permissionMap);for(let i of this.permissionSubscriptions)i();break}case "methodResponse":{let i=this.methodResponseHandlers.get(t.id);if(!i){switch(this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":throw new Error(`No handler for response with id ${t.id}`);case "api":{if(!(t.id<this.methodInvocationId))throw new Error(`No handler for unknown response id ${t.id}`);break}default:Se(this.mode);}break}this.methodResponseHandlers.delete(t.id),f(t.error)?i.reject(new et(t.error)):i.resolve(t.result);break}case "subscriptionMessage":{let{topic:i,payload:o}=t,a=this.subscriptions.get(i);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let i=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!i)throw new Error("Menu action received for an unknown menu item");i();break}default:Se(t);}},"onMessage");getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:Se(t);}}applyPluginTheme=r(e=>{mr(()=>{document.body.setAttribute("data-framer-theme",e.mode);for(let t in e.tokens)document.body.style.setProperty(t,e.tokens[t]);});},"applyPluginTheme");async cloneNode(e){let t=await this.invoke("cloneNode",e);return t?x(t,this):null}async cloneWebPage(e,t){let i=await this.invoke("cloneWebPage",e,t);c(i,"Expected to receive data for cloned web page");let o=x(i,this);return c(o instanceof K,"Expected cloned node to be an instance of WebPageNode"),o}async cloneDesignPage(e,t){let i=await this.invoke("cloneDesignPage",e,t);c(i,"Expected to receive data for cloned design page");let o=x(i,this);return c(o instanceof $,"Expected cloned node to be an instance of DesignPageNode"),o}async setAttributes(e,t){let i=await this.invoke("setAttributes",e,t);return i?x(i,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?x(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(i=>{let o=x(i,this);return c(Je(o)),o})}notify=r((e,t)=>{let i=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:i,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:r(()=>this.invoke("closeNotification",i),"close")}},"notify");async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=wt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let i=wt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",i,t);}};function la(n){return n.type==="component"}r(la,"isCodeFileComponentExport");function da(n){return n.type==="override"}r(da,"isCodeFileOverrideExport");var On=class{static{r(this,"CodeFileVersion");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get createdAt(){return this.#e.createdAt}get createdBy(){return this.#e.createdBy}constructor(e,t){this.#t=t,this.#e=e;}async getContent(){return await this.#t.invoke("getCodeFileVersionContent",this.#e.fileId,this.#e.id)}},Q=class n{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new n(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new n(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new On(t,this.#t))}async showProgressOnInstances(e){return this.#t.invoke("showProgressOnInstances",this.id,e)}async removeProgressFromInstances(){return this.#t.invoke("removeProgressFromInstances",this.id)}async lint(e){return Promise.resolve([])}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e,this.id)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Lt=class n{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new n(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let i=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!i)return null;let o=x(i,this.#t);return c(be(o)),o}};var ua=(()=>{let n=null;return {disableUntilMouseUp:r(()=>{if(n)return;n=document.createElement("style"),n.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(n);let e=r(()=>{n&&(document.head.removeChild(n),n=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),i=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",i);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",i);}r(o,"cleanup");},"disableUntilMouseUp")}})(),gr=5,ca=(()=>{let n=1;return {next:r(()=>`drag-${n++}`,"next")}})();function pa(){}r(pa,"noop");function fr(n,e,t,i){if(n.mode!=="canvas")return pa;let o=ca.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,u=se.subscribeToIsAllowedTo("makeDraggable",m=>{m||T();}),I=r(m=>{se.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&n.invoke("onDragEnd",{...m,dragSessionId:o}).then(h=>{try{i?.(h);}catch{}}).catch(h=>{if(h instanceof Error){i?.({status:"error",reason:h.message});return}if(typeof h=="string"){i?.({status:"error",reason:h});return}i?.({status:"error"});}),T());},"endDrag"),S=r(m=>{if(!se.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(m.buttons>0&&!!(m.buttons&1))){I({cancelled:false});return}let{clientX:A,clientY:z}=m;if(s.type==="pointerDown"){let E=A-s.dragStart.mouse.x,ut=z-s.dragStart.mouse.y;if(Math.abs(E)<gr&&Math.abs(ut)<gr)return;s={type:"dragging",dragStart:s.dragStart},n.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),ua.disableUntilMouseUp();}d.setPointerCapture(m.pointerId);let te={x:A,y:z};n.invoke("onDrag",{dragSessionId:o,mouse:te}).then(E=>{s.type==="dragging"&&(document.body.style.cursor=E??"");});},"handlePointerChange"),O=r(m=>{m.key==="Escape"&&I({cancelled:true});},"handleKeyDown"),_=r(()=>{I({cancelled:true});},"handleBlur"),b=r(m=>{if(!se.isAllowedTo("makeDraggable"))return;I({cancelled:true});let h=e.getBoundingClientRect(),A={x:h.x,y:h.y,width:h.width,height:h.height},z,te=e.querySelectorAll("svg");if(te.length===1){let ce=te.item(0).getBoundingClientRect();z={x:ce.x,y:ce.y,width:ce.width,height:ce.height};}let E={x:m.clientX,y:m.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:A,svgRect:z,mouse:E}},n.invoke("setDragData",o,t()),d.addEventListener("pointermove",S,true),d.addEventListener("pointerup",S,true),window.addEventListener("keydown",O,true),window.addEventListener("blur",_);},"handlePointerDown"),p=r(()=>{if(!se.isAllowedTo("makeDraggable"))return;let m=t();m.type==="detachedComponentLayers"&&n.invoke("preloadDetachedComponentLayers",m.url),m.type==="image"&&n.invoke("preloadImageUrlForInsertion",m.image),m.previewImage&&n.invoke("preloadDragPreviewImage",m.previewImage);},"preload");e.addEventListener("pointerdown",b),e.addEventListener("mouseenter",p);function T(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",S,true),d.removeEventListener("pointerup",S,true),window.removeEventListener("keydown",O,true),window.removeEventListener("blur",_);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",b),e.removeEventListener("mouseenter",p),I({cancelled:true}),u();}}r(fr,"makeDraggable");var Ce=class n{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[i]=await this.#t.invoke("addRedirects",[t]);return c(ct(i)),C(i)?null:new n(i,this.#t)}};var zn=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,i]=si(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,i(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new J}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let i=x(t,this.#e);return c(Je(i)),i})}async setSelection(e){let t=f(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let i=t.map(o=>{let a=x(o,this.#e);return c(Je(a)),a});e(i);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=x(e,this.#e);return c(Tn(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let i=x(t,this.#e);c(Tn(i)),e(i);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let i=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!i)return null;let o=x(i,this.#e);return c(o instanceof U),o}async removeNodes(e){return this.#e.invoke("removeNodes2",e)}async removeNode(e){return this.removeNodes([e])}async cloneNode(e){return this.#e.cloneNode(e)}async getNode(e){let t=await this.#e.invoke("getNode",e);return t?x(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let i=f(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",i,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,i){return this.#e.invoke("setParent",e,t,i)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(i=>x(i,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(i=>x(i,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(i=>x(i,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?y(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(y(this.#e,t));})}async addImage(e){let t=await Oe(e),i=Z(t);return this.#e.invokeTransferable("addImage",i,t)}async setImage(e){let t=await Oe(e),i=Z(t);return this.#e.invokeTransferable("setImage",i,t)}async uploadImage(e){let t=await Oe(e),i=Z(t),o=await this.#e.invokeTransferable("uploadImage",i,t);return y(this.#e,o)}async addImages(e){let t=await bn(e),i=t.flatMap(Z);await this.#e.invokeTransferable("addImages",i,t);}async uploadImages(e){let t=await bn(e),i=t.flatMap(Z),o=await this.#e.invokeTransferable("uploadImages",i,t);return y(this.#e,o)}async uploadFile(e){let t=await hn(e),i=await this.#e.invokeTransferable("uploadFile",Z(t),t);return y(this.#e,i)}async uploadFiles(e){let t=await Promise.all(e.map(hn)),i=t.flatMap(Z),o=await this.#e.invokeTransferable("uploadFiles",i,t);return y(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:i}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:i}),a=x(o,this.#e);return c(be(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:i}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:i}),a=x(o,this.#e);return c(Mt(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,i){return fr(this.#e,e,t,i)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return c(e,"Collection data must be defined"),new he(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return c(e,"Collections data must be defined"),e.map(t=>new he(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new ie(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new ie(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new ie(t,this.#e))}notify=r((e,t)=>this.#e.notify(e,t),"notify");async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return y(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?y(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return y(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let i=y(this.#e,t);return e(i)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return y(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?y(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return y(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let i=y(this.#e,t);return e(i)})}async getFont(e,t){let i=await this.#e.invoke("getFont",e,t);return i?y(this.#e,i):null}async getFonts(){let e=await this.#e.invoke("getFonts");return y(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(e){return this.#e.invoke("getLocalizationGroups",e)}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new Ce(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let i=t.map(o=>new Ce(o,this.#e));return e(i)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(i=>new Ce(i,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,i){let o=await this.#e.invoke("createCodeFile",e,t,i);return new Q(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let i of e)t.push(new Q(i,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new Q(t,this.#e):null}lintCode(e,t,i){return Promise.resolve([])}typecheckCode(e,t,i,o){return this.#e.invoke("typecheckCode",e,t,i,o)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let i=t?.map(o=>new Q(o,this.#e));return e(i)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let i=t?new Q(t,this.#e):null;return e(i)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),i=x(t,this.#e);return c(i instanceof $,"Expected node to be a DesignPageNode"),i}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),i=x(t,this.#e);return c(i instanceof K,"Expected node to be a WebPageNode"),i}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new ie(t,this.#e)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new he(t,this.#e)}async setCloseWarning(e){return this.#e.invoke("setCloseWarning",e)}get[l.initialState](){return this.#e.initialState}},Gn=class extends zn{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},nt=class extends Gn{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Lt(t,this.#e)}async[l.getAiServiceInfo](e){return this.#e.invoke(mt,e)}async[l.sendTrackingEvent](e,t,i){return this.#e.invoke(gt,e,t,i)}async[l.getCurrentUser](){return this.#e.invoke(ft)}async[l.getProjectInfo](){return this.#e.invoke(yt)}async[l.getHTMLForNode](e){return this.#e.invoke(me,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(ge,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let i=await this.#e.invoke("createNode","TextNode",t??null,e);if(!i)return null;let o=x(i,this.#e);return c(o instanceof oe),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let i=x(t,this.#e);return c(i instanceof ae),i}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new Qe(t,this.#e))}async createLocale(e){return this.#e.invoke("createLocale",e)}async getLocaleLanguages(){return this.#e.invoke("getLocaleLanguages")}async getLocaleRegions(e){return this.#e.invoke("getLocaleRegions",e)}async[v.publish](){return this.#e.invoke("publish")}async[v.getDeployments](){return this.#e.invoke("getDeployments")}async[v.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[v.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[v.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[v.createManagedCollection](e){return this.createManagedCollection(e)}[v.rejectAllPending](e){this.#e.rejectAllPending(e);}async[v.getAgentSystemPrompt](){return this.#e.invoke("getAgentSystemPrompt")}async[v.getAgentContext](e){return this.#e.invoke("getAgentContext",e)}async[v.readProjectForAgent](e,t){return this.#e.invoke("readProjectForAgent",e,t)}async[v.applyAgentChanges](e,t){return this.#e.invoke("applyAgentChanges",e,t)}async[v.startAgentConversation](e,t){return this.#e.invoke("startAgentConversation",e,t)}async[v.continueAgentConversation](e,t){return this.#e.invoke("continueAgentConversation",e,t)}async[v.submitAgentClarification](e){return this.#e.invoke("submitAgentClarification",e)}};var Kn=class{constructor(e){this.origin=e;}origin;static{r(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function ma(){return new Promise(n=>{function e({data:t,origin:i}){if(!cr(t))return;window.removeEventListener("message",e);let a={transport:new Kn(i),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:i,theme:t.theme??null,initialState:t.initialState};n(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(dr,"*");})}r(ma,"createBrowserContext");async function ga(){return typeof window>"u"||"Deno"in globalThis?null:ma()}r(ga,"bootstrap");var yr=await ga(),se=yr?new nt(new tt(yr)):new Proxy({},{get(n,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function hr(n){return new nt(new tt(n))}r(hr,"createFramerInstance");var br={};function ya(n){if(env)try{Object.assign(env,n);}catch{}Object.assign(br,n);}r(ya,"configure");function Ie(n,e){let t=br[n]??env[n];return t&&t.length>0?t:e}r(Ie,"getEnv");var xr=isWorkerd,jn=globalThis.WebSocket;async function Cr(n,e){let t=new URL(n.href);t.protocol=t.protocol==="wss:"?"https:":t.protocol==="ws:"?"http:":t.protocol;let o=(await fetch(t.href,{headers:{Upgrade:"websocket",...e}})).webSocket;if(!o)throw new Error("WebSocket upgrade failed - server did not accept");return o.accept(),o}r(Cr,"connectWebSocketCF");var Ir,Tr;try{Ir=await import('fs'),Tr=await import('path');}catch{}var Hn=Ir,_n=Tr;var le=(u=>(u.PROJECT_CLOSED="PROJECT_CLOSED",u.POOL_EXHAUSTED="POOL_EXHAUSTED",u.TIMEOUT="TIMEOUT",u.INTERNAL="INTERNAL",u.NODE_NOT_FOUND="NODE_NOT_FOUND",u.SCREENSHOT_TOO_LARGE="SCREENSHOT_TOO_LARGE",u.INVALID_REQUEST="INVALID_REQUEST",u.UNAUTHORIZED="UNAUTHORIZED",u))(le||{}),D=class extends Error{static{r(this,"FramerAPIError");}code;constructor(e,t){super(e),this.name="FramerAPIError",this.code=t,this.stack=void 0;}};function ha(n){return n instanceof D?n.code==="POOL_EXHAUSTED":false}r(ha,"isRetryableError");var ba=new Map(Object.values(le).map(n=>[n,n]));function Sr(n){return typeof n=="string"?ba.get(n)??"INTERNAL":"INTERNAL"}r(Sr,"parseErrorCode");var qn={silent:0,error:1,warn:2,info:3,debug:4};function xa(){let n=Ie("FRAMER_API_LOG_LEVEL")?.toLowerCase();return n&&n in qn?n:"warn"}r(xa,"getLogLevel");var Yn=xa();function it(n){return qn[n]<=qn[Yn]}r(it,"shouldLog");var rt=globalThis.console,Ca="\x1B[90m",Ia="\x1B[0m";function Ta(n){return n?`[FramerAPI:${n}]`:"[FramerAPI]"}r(Ta,"formatPrefix");function Pa(n,...e){return [Ca+n,...e,Ia]}r(Pa,"formatDebug");function Fr(n){let e=Ta(n);return {warn:r((...t)=>{it("warn")&&rt.warn(e,...t);},"warn"),error:r((...t)=>{it("error")&&rt.error(e,...t);},"error"),log:r((...t)=>{it("info")&&rt.log(e,...t);},"log"),info:r((...t)=>{it("info")&&rt.info(e,...t);},"info"),debug:r((...t)=>{it("debug")&&rt.debug(...Pa(e,...t));},"debug"),setLevel:r(t=>{Yn=t;},"setLevel"),getLevel:r(()=>Yn,"getLevel"),withRequestId:r(t=>Fr(t),"withRequestId")}}r(Fr,"createLogger");var k=Fr();k.warn;k.error;k.log;k.info;k.debug;k.setLevel;k.getLevel;var Rt="0.1.5";function ee(n,...e){if(n)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let i=t.stack.split(`
6
6
  `);i[1]?.includes("assert")?(i.splice(1,1),t.stack=i.join(`
7
7
  `)):i[0]?.includes("assert")&&(i.splice(0,1),t.stack=i.join(`
8
8
  `));}catch{}throw t}r(ee,"assert");var Dr;function vr({error:n,tags:e,extras:t,critical:i,caller:o}){ee(Dr,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Zn(n,o);return Dr({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!i}),a}r(vr,"reportError");function Zn(n,e=Zn){return n instanceof Error?n:new Xn(n,e)}r(Zn,"reportableError");var Xn=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let i=e?JSON.stringify(e):"No error message provided";if(super(i),this.message=i,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var ot=typeof window<"u"&&!("Deno"in globalThis)?window.location.hostname:void 0,Nr=!!(ot&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(ot)),Jn=(()=>{if(!ot)return;if(Nr)return {main:ot,previewLink:void 0};let n=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=ot.match(n);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({isDevelopment:Jn?.main==="development.framer.com",isProduction:Jn?.main==="framer.com"});var Bt;function Ut(){return typeof window>"u"?{}:Bt||(Bt=Da(),Bt)}r(Ut,"getServiceMap");function Da(){let n=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==n.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${n.origin})`);if(n.origin.endsWith("framer.com")||n.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let i=new URLSearchParams(n.search).get("services")||new URLSearchParams(n.hash.substring(1)).get("services");i&&(e=JSON.parse(i));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(Da,"extractServiceMap");function at(n,e=0,t=new Set){if(n===null)return n;if(typeof n=="function")return `[Function: ${n.name??"unknown"}]`;if(typeof n!="object")return n;if(n instanceof Error)return `[${n.toString()}]`;if(t.has(n))return "[Circular]";if(e>2)return "...";t.add(n);try{if("toJSON"in n&&typeof n.toJSON=="function")return at(n.toJSON(),e+1,t);if(Array.isArray(n))return n.map(i=>at(i,e+1,t));if(Object.getPrototypeOf(n)!==Object.prototype)return `[Object: ${"__class"in n&&n.__class||n.constructor?.name}]`;{let i={};for(let[o,a]of Object.entries(n))i[o]=at(a,e+1,t);return i}}catch(i){return `[Throws: ${i instanceof Error?i.message:i}]`}finally{t.delete(n);}}r(at,"jsonSafeCopy");var Qn=["trace","debug","info","warn","error"],va=["\u{1F50D}","\u{1F9EA}","\u2139\uFE0F","\u26A0\uFE0F","\u274C"],Na=[":trace",":debug",":info",":warn",":error"],Mr="logTimestamps";function Ar(n){return new Date(n).toISOString().substring(10,24)}r(Ar,"formatLogTimestamp");function wr(n,e){let t=[];for(let i of n.split(/[ ,]/u)){let o=i.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let I=0;I<=4;I++){let S=Na[I];if(S&&o.endsWith(S)){a=I,s&&(a+=1),o=o.slice(0,o.length-S.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+Ur(o).replace(/\\\*/gu,".*")+"$"),u=0;for(let I of e)I.id.match(d)&&(I.level=a,++u);u===0&&t.push(i);}return t}r(wr,"applyLogLevelSpec");var st=class n{constructor(e,t,i){this.logger=e;this.level=t;this.parts=i;this.id=n.nextId++,this.time=Date.now();}logger;level;parts;static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;cachedMessage;toMessage(){if(this.stringPrefix)return this.cachedMessage??this.parts;let e=[Qn[this.level]+": ["+this.logger.id+"]"];Ot&&e.unshift(Ar(this.time)),this.stringPrefix=e.join(" ");let t=this.parts[0];if(typeof t=="string"){let i=Va(t,this.logger.id,this.level);this.cachedMessage=[i.length>0?`${this.stringPrefix} ${i}`:this.stringPrefix,...this.parts.slice(1)];}else this.cachedMessage=[this.stringPrefix,...this.parts];return this.cachedMessage}resetMessagePrefix(){this.stringPrefix=void 0,this.cachedMessage=void 0;}toConsoleMessage(){let e=this.toMessage().slice(),t=e[0];if(typeof t!="string")return e;let i=Qn[this.level],o=va[this.level];i&&o&&(e[0]=t.replace(`${i}:`,`${o}`));let a=`[${this.logger.id}]`,s=e[0];if(typeof s!="string")return e;let d=s.indexOf(a);return d<0||(e[0]=s.slice(0,d)+"%c"+a+"%c"+s.slice(d+a.length),e.splice(1,0,"color: #9ca3af","")),e}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let i=JSON.stringify(at(e));return i?.length>253?i.slice(0,250)+"...":i}).join(" ")}},H="*:app:info,app:info",Ot=true,Vr=typeof process<"u"&&!!process.kill,ka=Vr&&!!process.env.CI;ka?H="-:warn":Vr&&(H="");try{typeof window<"u"&&window.localStorage&&(H=window.localStorage.logLevel||H,Ot=window.localStorage[Mr]!=="false");}catch{}try{typeof process<"u"&&(H=process.env.DEBUG||H);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:Rr,setLogTimestamps:Br});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",n=>{if(!n.data||typeof n.data!="object")return;let{loggerId:e,level:t,parts:i,printed:o}=n.data;if(typeof e!="string"||!Array.isArray(i)||i.length<1||typeof t!="number")return;let a=lt(e);if(t<0||t>5)return;i[0]=i[0].replace("[","*[");let s=new st(a,t,i);s.stringPrefix=i[0],j.push(s),!o&&(a.level>t||console?.log(...s.toConsoleMessage()));});}catch{}var ti;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(ti=r(n=>{try{let e=n.toMessage().map(s=>at(s)),t=n.logger,i=n.level,o=t.level<=n.level,a={loggerId:t.id,level:i,parts:e,printed:o};window.parent?.postMessage(a,Ut().app);}catch{}},"postLogEntry"));}catch{}var ei={},j=[],Wr=1e3;function de(n,e,t){let i=new st(n,e,t);for(j.push(i),ti?.(i);j.length>Wr;)j.shift();return i}r(de,"createLogEntry");function Lr(n){return typeof n=="number"&&(Wr=n),j}r(Lr,"getLogReplayBuffer");var Ea=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,Er;function Ma(){if(!(typeof window>"u"||!window.location))return Er??=Ea.exec(window.location.pathname)?.groups?.filename,Er}r(Ma,"getFilenameFromWindowPathname");function lt(n){let e=Ma();n=(e?e+":":"")+n;let t=ei[n];if(t)return t;let i=new zt(n);return ei[n]=i,wr(H,[i]),ti?.(new st(i,-1,[])),i}r(lt,"getLogger");function Rr(n,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=n);}catch{}let t=H;H=n;let i=Object.values(ei);for(let a of i)a.level=3;let o=wr(n,i);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&j.length>0){console?.log("--- LOG REPLAY ---");for(let a of j)a.logger.level>a.level||(a.level>=3?console?.warn(...a.toConsoleMessage()):console?.log(...a.toConsoleMessage()));console?.log("--- END OF LOG REPLAY ---");}return t}r(Rr,"setLogLevel");function Br(n){let e=Ot;Ot=n;for(let t of j)t.resetMessagePrefix();try{typeof window<"u"&&window.localStorage&&(window.localStorage[Mr]=String(n));}catch{}return e}r(Br,"setLogTimestamps");var Aa=r(n=>{let e={...n,logs:Lr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "framer-api",
3
- "version": "0.1.4-alpha.2",
3
+ "version": "0.1.5",
4
+ "license": "MIT",
4
5
  "type": "module",
5
6
  "types": "dist/index.d.ts",
6
7
  "exports": {
@@ -12,12 +13,13 @@
12
13
  },
13
14
  "main": "./dist/index.js",
14
15
  "files": [
15
- "dist/"
16
+ "dist/",
17
+ "LICENSE"
16
18
  ],
17
19
  "scripts": {
18
20
  "build": "tsup",
19
21
  "dev": "tsup --watch",
20
- "test": "jest",
22
+ "test": "yarn :jest",
21
23
  "analyze": "tsup --metafile && du -sh dist/*",
22
24
  "size": "du -sh dist/*",
23
25
  "lint": "yarn :lint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
@@ -39,12 +41,8 @@
39
41
  "@swc/core": "1.15.3",
40
42
  "@swc/jest": "^0.2.37",
41
43
  "@types/node": "24.10.15",
42
- "@typescript-eslint/eslint-plugin": "^8.55.0",
43
- "@typescript-eslint/parser": "^8.55.0",
44
- "eslint": "^8.57.1",
45
44
  "eslint-plugin-framer-studio": "1.0.0",
46
45
  "framer-plugin": "3.11.0-alpha.6",
47
- "jest": "29.4.1",
48
46
  "tsup": "^8.5.1",
49
47
  "tsx": "^4.19.2",
50
48
  "typescript": "^5.9.2",