forked from novasamatech/subquery-staking
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
5801-c42987e99b5eac45.min.js.br
7 lines (5 loc) · 102 KB
/
5801-c42987e99b5eac45.min.js.br
1
2
3
4
5
6
7
"use strict";
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1eff508c-f03e-5972-97b3-3c2e3329152a")}catch(e){}}();
(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[5801],{297557:(e,t,r)=>{function n(e){return"backend"in e&&"fullscreen"===e.backend}function i(e){switch(e){case"server_file":case"local_file":case"server_checkpoint":case"pasted_data":return!0;case"server_checkpoint_diff":case"local_diff_file":case"multiplayer_journal":return!1}}function l(e){switch(e.type){case"server_file":case"local_file":case"server_checkpoint":case"pasted_data":return!0;case"server_checkpoint_diff":case"local_diff_file":case"multiplayer_journal":case"multiplayer_journals":return!1}}function a(e){switch(e.type){case"server_checkpoint_diff":case"local_diff_file":return!0;case"server_file":case"local_file":case"server_checkpoint":case"multiplayer_journal":case"multiplayer_journals":case"pasted_data":return!1}}r.d(t,{F1:()=>l,GP:()=>i,HP:()=>a,_g:()=>n})},651492:(e,t,r)=>{r.d(t,{I:()=>S});var n=r(695614),i=r(527626),l=r(664080),a=r(667060),s=r(783161),o=r(210106),u=r(961837),c=r(291909),d=r(438396),h=r(999275),p=r(794307),m=r(474554);function f(e,t){switch(e){case l.J0O.BOOL:return{type:c.hy.Boolean,value:t.boolValue};case l.J0O.TEXT:return{type:c.hy.SensitiveText,value:t.textValue};case l.J0O.INSTANCE_SWAP:return{type:c.hy.NodeId,value:(0,o.wr)(t.instanceSwapValue)};default:if(t.untypedValue)return{type:c.hy.SensitiveText,value:t.untypedValue};return}}function y(e,t){let r=[];return e.error&&r.push((0,d.Jt)("Error",{type:c.hy.String,value:e.error})),e.propType&&r.push((0,d.Jt)("Prop Type",{type:c.hy.String,value:(0,m.xb)(e.propType)})),e.explicitDefID&&(r.push((0,d.Jt)("Explicit Def ID",{type:c.hy.GenericGuid,value:(0,o.wr)(e.explicitDefID)})),t&&r.push((0,d.lh)("Explicit Def State Group",t))),r.push((0,d.w_)({label:"Ref Nodes",list:e.refNodes,buildChild:g,expandByDefault:!1})),r}function g(e,t){return{label:e,value:{type:c.hy.NodeId,value:(0,o.wr)(t.refNodeGuid)},children:[{label:e,value:{type:c.hy.String,value:t.nodeField},children:[],expandByDefault:!1}],expandByDefault:!1}}function v(e,t,r){return(0,d.w_)({label:e,list:t,buildChild:(e,t)=>(function(e,{edges:t},r){let n=1===t.length?E(t[0],!1):[(0,d.Jt)("Type",{type:c.hy.String,value:"Transitive"}),(0,d.w_)({label:"Edges",list:t,buildChild:(e,t)=>({label:e,children:E(t,!0),expandByDefault:!0}),expandByDefault:!0})];return{label:e,value:{type:c.hy.NodeId,value:(0,o.wr)(r===l.Uze.FROM?t[t.length-1].toGuid:t[0].fromGuid)},children:n,expandByDefault:!1}})(e,t,r),expandByDefault:!1})}function E({fromGuid:e,toGuid:t,type:r,pathToOverride:n,propDefId:i},a){let s=[(0,d.Jt)("Type",{type:c.hy.String,value:function(e){switch(e){case l.SoG.PRIMARY_INSTANCE_BACKED_BY_SYMBOL:return"Primary instance backed by symbol";case l.SoG.PRIMARY_INSTANCE_WITH_NESTED_SWAP_TO_SYMBOL:return"Primary instance with nested swap to symbol";case l.SoG.PRIMARY_INSTANCE_WITH_TOP_LEVEL_PROP_ASSIGNMENT_TO_SYMBOL:return"Primary instance with top level prop assignment to symbol";case l.SoG.PRIMARY_INSTANCE_WITH_NESTED_PROP_ASSIGNMENT_TO_SYMBOL:return"Primary instance with nested prop assignment to symbol";case l.SoG.PRODUCT_COMPONENT_WITH_PROP_DEF_TO_SYMBOL:return"Product component with prop def to symbol";case l.SoG.STATE_WITH_PROP_DEF_TO_SYMBOL:return"State with prop def to symbol";case l.SoG.SYMBOL_CONTAINING_PRIMARY_INSTANCE:return"Symbol containing primary instance";case l.SoG.INVALID:return"Invalid";default:(0,p.xb)(e)}}(r)})];a&&(s.push((0,d.lh)("From",e)),s.push((0,d.lh)("To",t))),n.length>1&&s.push((0,d.Jt)("Path to override",{type:c.hy.OverridePath,value:(0,o.ZJ)(n)}));let u=(0,o.SR)(i);return u&&s.push((0,d.Jt)("Prop def id",{type:c.hy.GenericGuid,value:(0,o.wr)(u)})),s}class S extends h.X{constructor({inPrototypeViewer:e,...t}){super(t),this.nodesById=new Map,this.stylesById=new Map,this.variablesById=new Map,this.variableCollectionsById=new Map,this.searchDB=new s.V,this.inPrototypeViewer=e}memoryUsage(){if(this._memoryUsage)return this._memoryUsage;let e=this.getRootNodes().reduce((e,t)=>e+t.treeMemoryUsage,0);return this._memoryUsage=e}getResourceMetadata(){return{migrationVersion:l.Hcu.getFileVersion()}}getResourceMetadataDisplayInfo(){return{"Migration version":this.getResourceMetadata().migrationVersion.toString()}}getRootNodes(){return this.fetchNodesFromFullscreen(()=>l.Hcu.getRootNodes())}getNode(e){return this.getNodeFromCache(e)||this.fetchNodeFromFullscreen(()=>l.Hcu.getNode((0,o.qJ)(e)))}getChildren(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getChildren((0,o.qJ)(e)))}getStyle(e){return this.getStyleFromCache(e)||this.fetchNodeFromFullscreen(()=>l.Hcu.getStyle(e))}getVariable(e){return this.getVariableFromCache(e)||this.fetchNodeFromFullscreen(()=>l.Hcu.getVariable(e))}getVariableCollection(e){return this.getVariableCollectionFromCache(e)||this.fetchNodeFromFullscreen(()=>l.Hcu.getVariableCollection(e))}getStyleConsumers(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getStyleConsumers(e))}getConsumedStyles(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getConsumedStyles((0,o.qJ)(e)))}getConsumedVariables(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getConsumedVariables((0,o.qJ)(e)))}getVariablesInCollection(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getVariablesInCollection(e))}getVariableConsumers(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getVariableConsumers(e))}getDirectVariableDependenciesToVariable(e){return this.fetchNodesFromFullscreen(()=>l.Hcu.getDirectVariableDependenciesToVariable(e))}getPropDefs(e){let t=(0,o.SR)(e);return null==t?[]:l.Hcu.getPropDefs(t)}getCombinedPropAssignments(e){let t=(0,o.SR)(e);return null==t?[]:l.Hcu.getCombinedPropAssignments(t)}getTransitiveDependencyPaths(e,t){let r=(0,o.SR)(e);return null==r?[]:l.Hcu.getTransitiveDependencyPaths(r,t)}getAllOverridesForLayer(e){let t=(0,o.SR)(e);return null==t?[]:l.Hcu.getLayerOverrides(t).map(e=>({...e,fields:i.w.decodeMessage(e.fields).nodeChanges[0]}))}getAllSublayerInfoForImmutableFrame(e){let t=(0,o.SR)(e);return null==t?new Map:l.Hcu.getImmutableFrameSubLayerInfo(t)}getOverrideStash(e){let t=(0,o.SR)(e);return null==t?[]:l.Hcu.getOverrideStash(t).map(e=>({...e,overrides:e.overrides.map(e=>({...e,fields:i.w.decodeMessage(e.fields).nodeChanges[0]}))}))}getTextInsertionStyle(e){let t;let r=(0,o.SR)(e);if(null==r)return[];let n=l.Hcu.getTextInsertionStyle(r);if(0===n.length)return[];try{t=i.w.decodeMessage(n).nodeChanges}catch(e){return console.warn("FigmaScope: error decoding node changes",e),[]}return t?t.length>1?(console.warn("FigmaScope: more than one node change found for text insertion style"),[]):t:(console.warn("FigmaScope: buffer did not contain node changes"),[])}getBlobByIndex(e){return"showing blob bytes is not implemented"}supportsNodePreviews(){return"show"===this.sensitiveTextPolicy&&!this.inPrototypeViewer}async search(e,t,r){return(await this.indexedSearchDB(r)).search(e,t)}indexedProperties(){return this.searchDB.indexedProperties}getNodeFromCache(e){return this.nodesById.get((0,o.qJ)(e))??null}getStyleFromCache(e){return this.stylesById.get(e)??null}getVariableFromCache(e){return this.variablesById.get(e)??null}getVariableCollectionFromCache(e){return this.variableCollectionsById.get(e)??null}fetchNodeFromFullscreen(e){let t=this.fetchNodesFromFullscreen(e);return t.length>1&&console.error("FigmaScope: Multiple nodes found",t),t[0]??null}fetchNodesFromFullscreen(e){let t,r;try{t=e()}catch(e){return console.error("FigmaScope: error fetching nodes"),[]}try{r=i.w.decodeMessage(t).nodeChanges}catch(e){return console.error("FigmaScope: error decoding node changes",e),[]}return r?r.map(e=>{let t=(0,o.qJ)(e.guid),r=this.nodesById.get(t);if(r)return r;let n=new b(e,this);if(this.nodesById.set(t,n),n.isStyle()){let e=n.styleId();e&&this.stylesById.set(e,n)}if(n.isVariable()){let e=n.variableId();e&&this.variablesById.set(e,n)}if(n.isVariableCollection()){let e=n.variableCollectionId();e&&this.variableCollectionsById.set(e,n)}return n}):(console.error("FigmaScope: missing nodeChanges property"),[])}indexedSearchDB(e){if(this._indexedSearchDB)return this._indexedSearchDB;let t=0,r=this.getRootNodes(),n=async()=>{await scheduler.postTask(async()=>{let i=Date.now();for(;Date.now()-i<100;){let n=r.pop();if(!n)return;e&&++t%5e3==0&&e(t),this.searchDB.indexNode(n),r.push(...n.children().filter(e=>e.guid))}await n()})},i=n().then(()=>this.searchDB);return this._indexedSearchDB=i}}class b extends u.H{constructor(e,t){super(e,t),this.memoryUsage=l.Hcu.getNodeMemoryUsage(this.guidStr()),this.treeMemoryUsage=l.Hcu.getSubtreeMemoryUsage(this.guidStr()),this.hasBeenLoaded=l.Hcu.getHasBeenLoaded(this.guidStr())}memoryPercentStr(){return(0,a.pr)(this.treeMemoryUsage,this._scene.memoryUsage(),!1)}transitiveDependencyPaths(e){return this._scene.getTransitiveDependencyPaths(this.guid(),e)}consumedStyleIds(){return this.consumedStyles().map(e=>e.styleId()).filter(n.Vq)}consumedStyles(){return this._scene.getConsumedStyles(this.guid())}consumedVariableIds(){return this.consumedVariables().map(e=>e.variableId()).filter(n.Vq)}consumedVariables(){return this._scene.getConsumedVariables(this.guid())}variablesThatDirectlyDependOnThisVariable(){let e=this.variableId();return e?this._scene.getDirectVariableDependenciesToVariable(e):[]}propDefs(){return this._scene.getPropDefs(this.guid())}combinedPropAssignments(){return this._scene.getCombinedPropAssignments(this.guid())}allLayerOverrides(){return this._scene.getAllOverridesForLayer(this.guid())}overrideStash(){return this._scene.getOverrideStash(this.guid())}keyForPublish(){return super.key()??(this.isLocalAsset()&&l.Egt?l.Egt.getAssetKeyForPublish(this.guidStr()):void 0)}allImmutableFrameSublayerInfo(e){return this._scene.getAllSublayerInfoForImmutableFrame(e)}textInsertionStyle(e){let t=this._scene.getTextInsertionStyle(e);return 1===t.length?t[0]:null}sublayerOverridesFromContainingImmutableFrame(){let e=this.containingImmutableFrame();if(!e)return null;let t=this.allImmutableFrameSublayerInfo(e.guid());if(!t||0===t.size)return null;let r=Array.from(t).find(e=>e[1].sublayerGuid===this.guidStr());if(!r)return null;let n=e.immutableFrameSublayerOverridesList();return 0===n.length?null:n.find(e=>{var t,n;let i=null==(t=e.guidPath)?void 0:t.guids;return`[${null==(n=null==i?void 0:i.map(e=>(0,o.qJ)(e)))?void 0:n.join(", ")}]`===r[0]})}generateComputedProperties(){var e,t,r;let i=[(0,d.sq)(this.type())];"DOCUMENT"===this.nodeType()&&Object.entries(this._scene.getResourceMetadataDisplayInfo()).forEach(([e,t])=>{i.push((0,d.Jt)(e,{type:c.hy.String,value:t}))}),this.hasBeenLoaded&&i.push((0,d.Jt)("Has Been Loaded",{type:c.hy.Boolean,value:this.hasBeenLoaded}));let a=this.keyForPublish(),s=(0,d.qU)(this,a);if(s&&i.push(s),i.push({label:"Memory usage",children:[(0,d.Jt)("Node",{type:c.hy.Numeric,value:this.memoryUsage}),(0,d.Jt)("Tree",{type:c.hy.Numeric,value:this.treeMemoryUsage})],expandByDefault:!0}),this.isPrimaryInstance()){let e=(0,d._9)(this);e&&i.push(e);let t=(0,d.az)(this);t&&i.push(t);let r=this.overrideStash();r&&i.push((0,d.w_)({label:"Override stash",list:r,expandByDefault:!1,buildChild:(e,t)=>({label:e,value:t.pathToSwap?{type:c.hy.OverridePath,value:(0,o.ZJ)(t.pathToSwap)}:void 0,children:[(0,d.w_)({label:e,value:{type:c.hy.NodeId,value:(0,o.wr)(t.symbolId)},list:t.overrides,expandByDefault:!1,buildChild:(e,t)=>(0,d.tN)({label:e,value:{type:c.hy.OverridePath,value:(0,o.ZJ)(t.overridePath)},object:t.fields,buildChild:(e,t)=>null==t?null:(0,d.oy)(e,t),expandByDefault:!1})})],expandByDefault:!1})}))}let u=this.instanceChain();if(u.length>0){i.push({label:"Instance chain",value:{type:c.hy.Metadata,value:u.length},expandByDefault:!0,children:u.map((e,t)=>(function(e,t){let r=e.isInstance(),i=e.isPrimaryInstance(),l=[];if(r){l.push((0,d.VX)(e));let t=(0,d.fG)(e);t&&l.push(t)}return i||l.push((0,d.Jt)("Override path",{type:c.hy.OverridePath,value:t.slice(1).map(e=>e.overrideKey()).filter(n.Vq)})),{label:r?i?"Primary instance":"Nested instance":"This sublayer",key:String(t.length),value:{type:c.hy.NodeId,value:e.guid()},children:l,expandByDefault:!1}})(e,u.slice(0,t+1)))});let e=this.allLayerOverrides();if(e){let t=function(e){let t={};for(let{primaryInstanceId:r,containingSymbolId:n,fields:i,savedLevel:l,inheritanceLevel:a}of e)for(let[e,s]of Object.entries(i))t[e]=t[e]||[],t[e][a]={primaryInstanceId:r,containingSymbolId:n,value:s,savedLevel:l};let r=Object.keys(t).sort();return 0===r.length?null:(0,d.w_)({label:"Layer overrides",list:r,expandByDefault:!1,buildChild:(e,r)=>{let i=t[r],l=i.findIndex(n.Vq),a=i[l].value;return{label:r,value:{type:c.hy.Metadata,value:0===l?"Direct override":"Inherited override"},expandByDefault:!1,children:[{...(0,d.oy)(r,a),label:"Resolved value",expandByDefault:!0},{label:"Sources",expandByDefault:!1,children:i.map(({primaryInstanceId:e,containingSymbolId:t,value:i,savedLevel:l},a)=>({label:0===a?"Direct override":"Inherited from",key:`Level ${a}`,value:t?{type:c.hy.NodeId,value:(0,o.wr)(t)}:void 0,children:[{...(0,d.oy)(r,i),label:"Value"},l>0?(0,d.Jt)("Saved level",{type:c.hy.Numeric,value:l}):null,(0,d.lh)("Primary instance",e)].filter(n.Vq),expandByDefault:!1})).filter(n.Vq)}]}}})}(e);t&&i.push(t)}}if((this.isSymbol()||this.isPrimaryInstance())&&(i.push(v("Dependants",this.transitiveDependencyPaths(l.Uze.TO),l.Uze.TO)),i.push(v("Dependencies",this.transitiveDependencyPaths(l.Uze.FROM),l.Uze.FROM))),this.isStateGroup()&&(i.push((0,d.w_)({label:"Dependants By State",list:this.children(),buildChild:(e,t)=>({...v(`State ${e}`,t.transitiveDependencyPaths(l.Uze.TO),l.Uze.TO),value:{type:c.hy.NodeId,value:t.guid()}}),expandByDefault:!0})),i.push((0,d.w_)({label:"Dependencies By State",list:this.children(),buildChild:(e,t)=>({...v(`State ${e}`,t.transitiveDependencyPaths(l.Uze.FROM),l.Uze.FROM),value:{type:c.hy.NodeId,value:t.guid()}}),expandByDefault:!0}))),this.isStyle()&&i.push((0,d.cT)(this.styleConsumers())),this.isVariable()){let e=this._scene.getVariableCollection(this.variableCollectionId());i.push((0,d.dW)(e)),i.push((0,d.dL)(this.variableConsumers()))}let h=this.variablesDirectlyDependedOnByThisVariable();Object.values(h).some(e=>e.length>0)&&i.push((0,d.q7)(h));let p=this.variablesThatDirectlyDependOnThisVariable();p.length>0&&i.push((0,d.PS)(p));let m=this.consumedStyles();m.length>0&&i.push((0,d.Oj)(m));let g=this.consumedVariables();if(g.length>0&&i.push((0,d.PT)(g)),this.isVariableCollection()&&i.push((0,d.SP)(this.variablesInCollection())),this.isSymbol()||this.isStateGroup()){let t=this.propDefs();if(t.length>0){let r=this.isState()?null==(e=this.parent())?void 0:e.guidStr():void 0;i.push((0,d.w_)({label:"Component Prop Defs",list:t,buildChild:(e,t)=>(function(e,t){let r=[(0,d.Jt)("Is Explicit",{type:c.hy.Boolean,value:e.isExplicit})],n=f(e.propType,e.defaultValue);return n&&r.push((0,d.Jt)("Default Value",n)),r.push(...y(e,t)),{label:e.defID,value:{type:e.name?c.hy.SensitiveText:c.hy.String,value:e.name?e.name:"INVALID_PROP"},children:r,expandByDefault:!1}})(t,r),expandByDefault:!1}))}}if(this.isInstance()){let e=this.combinedPropAssignments();e.length>0&&i.push((t=this.backingStateGroup(),(0,d.w_)({label:"Component Prop Assignments",list:e,buildChild:(e,r)=>(function(e,t){let r=[],n=f(e.propType,e.assignmentValue);return n&&r.push((0,d.Jt)("Assignment Value",n)),r.push((0,d.Jt)("Is Mixed",{type:c.hy.Boolean,value:e.isMixed})),r.push(...y(e,t)),{label:e.assignmentID,value:{type:e.name?c.hy.SensitiveText:c.hy.String,value:e.name?e.name:"INVALID_PROP"},children:r,expandByDefault:!1}})(r,t),expandByDefault:!1})))}let E=this.otherAssetVersions(e=>{var t;return null==(t=this._scene.getNode(e))?void 0:t.keyForPublish()});E.length>0&&i.push((0,d.nn)(E));let S=this.isVariable()||this.isVariableCollection(),b=this.transform();if(b&&!S){let e=(0,d.Ro)("Relative transform",b,this.isEditable(),this.guidStr());i.push(e)}let I=this.absoluteTransform();if(I&&!S&&i.push((0,d.Ro)("Absolute transform",I)),"TEXT"===this.type()){let e=this.textInsertionStyle(this.guid());if(e){let t=(0,d.Lk)(e);t&&i.push(t)}}if(this.isImmutableFrame()){let e=this.allImmutableFrameSublayerInfo(this.guid());if(e){let t=(0,d.St)(this,e);t&&i.push(t)}}if(this.isImmutableFrameSublayer()){let e=this.sublayerOverridesFromContainingImmutableFrame();if(e){let t=(0,d.gq)(this,e);t&&i.push(t)}}return this._scene.supportsNodePreviews()&&this.isPreviewRenderable()&&i.push((r=this.guid(),{label:"Node Preview",children:[(0,d.Jt)("",{type:c.hy.Image,value:r})],expandByDefault:!1})),i}}},210106:(e,t,r)=>{r.d(t,{SR:()=>s,ZJ:()=>c,bb:()=>u,dL:()=>o,qJ:()=>l,wr:()=>a});var n=r(695614),i=r(183518);function l(e){return"string"==typeof e?e:i.dI(e)}function a(e){return"string"==typeof e?i.sH(e):e}function s(e){let t=l(e);return t===i.AD?null:t}function o(e){return!!function(e){let t=a(e);return i.fn(t)?t:null}(e)}function u(e){return Array.isArray(e)?e.map(l).join(", "):e}function c(e){return"string"==typeof e?e.split(", ").map(i.sH).filter(n.Vq):"string"==typeof e[0]?e.map(a).filter(n.Vq):e}},888887:(e,t,r)=>{r.d(t,{R4:()=>h,i0:()=>m});var n=r(794307),i=r(611464),l=r(77083),a=r(62385),s=r(183518),o=r(303896),u=r(19599),c=r(210106),d=r(262919);class h{constructor(e){this.nodeChange=e,this.memoryUsage=null,this.treeMemoryUsage=null}memoryPercentStr(){return null}instanceChain(){let e=this.filterAncestors(e=>e.isInstance()).reverse();return(e.length>0||this.isInstance())&&e.push(this),e}followOverridePath(e){let t=this;for(let r of e){if(!t)return;let e=(0,c.qJ)(r);t=t.findDescendant(t=>t.overrideKeyStr()===e,{includeSelf:!0,shouldSkipAfter:e=>e!==t&&e.isInstance()})}return t}ancestorPath(){return this.mapAncestors(e=>e.guid(),{includeSelf:!0})}ancestorPathStr(){return(0,c.bb)(this.ancestorPath())}guid(){return this.nodeChange.guid??s.Hr}guidStr(){return s.dI(this.guid())}key(){var e,t;return(0,a.sg)(this.nodeChange.key??this.nodeChange.componentKey??((null==(e=this.nodeChange.sharedStyleMasterData)?void 0:e.styleKey)||(null==(t=this.nodeChange.sharedStyleReference)?void 0:t.styleKey)||void 0))}version(){return(0,a.Xf)(this.nodeChange.version??this.nodeChange.sharedSymbolVersion)}assetRef(){return a.iU.fromKiwi({key:this.key(),version:this.version()})}_assetId(e){if(!this.isSubscribedAsset())return e.fromLocalNodeIdObj(this.guid());{let t=this.assetRef();return t?e.fromRef(t):null}}symbolId(){return this.isSymbol()?this._assetId(l.Ws):null}stateGroupId(){var e;return this.isStateGroup()?this._assetId(l.GU):this.isSymbol()?(null==(e=this.parent())?void 0:e.stateGroupId())??null:null}styleId(){return this.isStyle()?this._assetId(l.PK):null}variableId(){return this.isVariable()?this._assetId(l.sD):null}variableCollectionId(){return this.isVariableCollection()?this._assetId(l.gr):this.isVariable()&&this.nodeChange.variableSetID?l.gr.fromKiwi(this.nodeChange.variableSetID):null}backingSymbolId(){var e;return this.isInstance()?(null==(e=this.nodeChange.symbolData)?void 0:e.symbolID)??this.nodeChange.overriddenSymbolID??null:null}getFriendlyVariableModeString(e){var t;if(!this.isVariableCollection())return"";let r=s.dI(e),n=null==(t=this.nodeChange.variableSetModes)?void 0:t.find(t=>s.aI(t.id,e));return n?`${n.name} (${r})`:`<missing mode> (${r})`}nodeType(){return this.nodeChange.type??"NONE"}isEditable(){return"CANVAS"!==this.nodeType()&&"DOCUMENT"!==this.nodeType()&&!this.isImmutableFrameSublayer()&&!this.isInstanceSublayer()&&!this.isInternalOnly()}isPreviewRenderable(){return"CANVAS"!==this.nodeType()&&"DOCUMENT"!==this.nodeType()&&!this.isStateGroup()&&!this.isVariableCollection()&&!this.isVariable()}type(){let e=this.nodeType();if("INSTANCE"===e)return this.isPrimaryInstance()?"PRIMARY_INSTANCE":"NESTED_INSTANCE";if("VARIABLE_SET"===e)return"VARIABLE_COLLECTION";if(this.isStateGroup())return"STATE_GROUP";if(this.isState())return"STATE";if(this.isStyle()){let e=this.nodeChange.styleType;switch(e){case"FILL":return"FILL_STYLE";case"STROKE":return"STROKE_STYLE";case"TEXT":return"TEXT_STYLE";case"EFFECT":return"EFFECT_STYLE";case"EXPORT":return"EXPORT_STYLE";case"GRID":return"GRID_STYLE";default:(0,n.j)(e)}}return e}phase(){return this.nodeChange.phase??"MODIFIED"}transform(){return this.nodeChange.transform}parentGuid(){let e=this.nodeChange.parentIndex;return e?e.guid||(console.warn("Node has parent index but no parent guid",this,e),null):null}nameWithPage(){let e=this.containingPage();return e?`${e.name()} > ${this.name()}`:this.name()}explicitOverrideKey(){return this.nodeChange.overrideKey}overrideKey(){let e=this.explicitOverrideKey();if(e)return e;if(this.isPrimaryInstance()){let e=this.backingSymbol();if(e)return e.isSubscribedAsset()?e.explicitOverrideKey():e.guid()}}overrideKeyStr(){let e=this.overrideKey();return e?(0,c.qJ)(e):null}treeDiffKey(){let e=this.instanceChain();return e.length>1?e.map((e,t)=>0===t?e.guidStr():e.overrideKeyStr()).join(", "):this.guidStr()}publishId(){return this.nodeChange.publishID??null}publishFile(){return this.nodeChange.publishFile??null}isInstance(){return"INSTANCE"===this.nodeType()}isPrimaryInstance(){return this.isInstance()&&!this.isNestedInstance()}isNestedInstance(){return"INSTANCE"===this.nodeType()&&this.someAncestor(e=>e.isInstance())}isInstanceSublayer(){return this.someAncestor(e=>e.isInstance())}isSwappedNestedInstance(){return this.isNestedInstance()&&null!=this.nodeChange.overriddenSymbolID}isSymbol(){return"SYMBOL"===this.nodeType()}isStateGroup(){return"FRAME"===this.nodeType()&&null!=this.nodeChange.isStateGroup}isState(){var e;return this.isSymbol()&&!!(null==(e=this.parent())?void 0:e.isStateGroup())}isLooseComponent(){return this.isSymbol()&&!this.isState()}isComponentish(){return this.isSymbol()||this.isStateGroup()}isProductComponent(){return this.isStateGroup()||this.isLooseComponent()}isStyle(){return this.nodeChange.styleType&&u.og.indexOf(this.nodeChange.styleType)>-1}isVariable(){return"VARIABLE"===this.nodeType()}isVariableCollection(){return this.isRootVariableCollection()||this.isExtendedVariableCollection()}isRootVariableCollection(){return!!("VARIABLE_SET"===this.nodeType()&&!this.nodeChange.backingVariableSetId)}isExtendedVariableCollection(){return!!("VARIABLE_SET"===this.nodeType()&&this.nodeChange.backingVariableSetId)}isVariableOverride(){return"VARIABLE_OVERRIDE"===this.nodeType()}isAsset(){return this.isSymbol()||this.isStateGroup()||this.isStyle()||this.isVariable()||this.isVariableCollection()||this.isVariableOverride()}isLocalAsset(){return this.isAsset()&&!this.isSubscribedAsset()}isSubscribedAsset(){return this.isComponentish()?(0,i.kc)().ds_publish_file_deprecation?null!=this.nodeChange.publishID:null!=this.nodeChange.publishFile:this.isStyle()?this.nodeChange.key?this.nodeChange.key&&this.nodeChange.version:null!=this.nodeChange.sharedStyleReference:!!(this.isVariable()||this.isVariableCollection())&&!!this.nodeChange.key}isInternalOnly(){var e;return this.nodeChange.internalOnly||(null==(e=this.parent())?void 0:e.isInternalOnly())||!1}isStack(){return null!=this.nodeChange.stackMode&&"NONE"!==this.nodeChange.stackMode}isCanvas(){return"CANVAS"===this.nodeChange.type}isImmutableFrame(){let e=this.nodeType();return"STICKY"===e||"SHAPE_WITH_TEXT"===e||"CONNECTOR"===e||"CODE_BLOCK"===e||"MEDIA"===e||"SECTION_OVERLAY"===e||"TABLE"===e}isImmutableFrameSublayer(){return!this.isImmutableFrame()&&this.someAncestor(e=>e.isImmutableFrame())}containingImmutableFrame(){return this.findAncestor(e=>e.isImmutableFrame())}containingPage(){return this.findAncestor(e=>"CANVAS"===e.type())}derivedOverridesList(){return this.nodeChange.derivedSymbolData??[]}overridesList(){var e;return(null==(e=this.nodeChange.symbolData)?void 0:e.symbolOverrides)??[]}immutableFrameSublayerOverridesList(){var e;return(null==(e=this.nodeChange.nodeGenerationData)?void 0:e.overrides)??[]}imageHashes(){var e,t,r,n,i,l,a;let s=[],u=e=>{(null==e?void 0:e.hash)&&s.push((0,o.qg)(e))},c=e=>{u(e.image),u(e.imageThumbnail),u(e.animatedImage)},d=e=>{if(e)for(let t of e)c(t)};d(this.nodeChange.fillPaints),d(this.nodeChange.strokePaints),d(this.nodeChange.backgroundPaints),d(null==(e=this.nodeChange.widgetHoverStyle)?void 0:e.fillPaints),d(null==(t=this.nodeChange.widgetHoverStyle)?void 0:t.strokePaints);let h=e=>{e&&s.push(e)};return h(null==(r=this.nodeChange.embedData)?void 0:r.thumbnailImageHash),h(null==(n=this.nodeChange.embedData)?void 0:n.faviconImageHash),h(null==(i=this.nodeChange.linkPreviewData)?void 0:i.thumbnailImageHash),h(null==(l=this.nodeChange.linkPreviewData)?void 0:l.faviconImageHash),h(null==(a=this.nodeChange.richMediaData)?void 0:a.mediaHash),s}otherAssetVersions(e){if(!this.isAsset())return[];let t=this.containingPage();if(!t)return[];let r=this.nodeType(),n=this.guidStr(),i=this.key()??(null==e?void 0:e(n));return i?t.children().filter(t=>{if(t.nodeType()!==r)return!1;let l=t.guidStr();return l!==n&&(t.key()??(null==e?void 0:e(l)))===i}):[]}forEachDescendant(e,t){return(0,d.zV)(this,m,e,t)}mapDescendants(e,t){return(0,d.o6)(this,m,e,t)}filterDescendants(e,t){return(0,d.is)(this,m,e,t)}findDescendant(e,t){return(0,d.cy)(this,m,e,t)}countDescendants(e,t){return(0,d.d8)(this,m,e,t)}someDescendant(e,t){return(0,d.Ng)(this,m,e,t)}everyDescendant(e,t){return(0,d.AH)(this,m,e,t)}forEachAncestor(e,t){return(0,d.zV)(this,p,e,t)}mapAncestors(e,t){return(0,d.o6)(this,p,e,t)}filterAncestors(e,t){return(0,d.is)(this,p,e,t)}findAncestor(e,t){return(0,d.cy)(this,p,e,t)}countAncestors(e,t){return(0,d.d8)(this,p,e,t)}someAncestor(e,t){return(0,d.Ng)(this,p,e,t)}everyAncestor(e,t){return(0,d.AH)(this,p,e,t)}nodeFieldProperties(){return this._nodeFieldProperties?this._nodeFieldProperties:this._nodeFieldProperties=this.generateNodeFieldProperties()}computedProperties(){return this._computedProperties?this._computedProperties:this._computedProperties=this.generateComputedProperties()}}function p(e){let t=e.parent();return t?[t]:[]}function m(e){return e.children()}},262919:(e,t,r)=>{r.d(t,{AH:()=>p,Ng:()=>h,cy:()=>u,d8:()=>d,is:()=>c,o6:()=>o,zV:()=>s});var n=r(461816),i=r.n(n);let l=()=>!0,a=e=>Array.isArray(e)?e:[e];function s(e,t,r,{includeSelf:n,shouldSkipAfter:l,shouldBreakAfter:s}={}){let o=a(e),u=n?[...o]:i()(o,t);for(;;){let e=u.pop();if(!e||(r(e),null==s?void 0:s(e)))return;if(!(null==l?void 0:l(e)))for(let r of t(e))u.push(r)}}function o(e,t,r,n={}){let i=[];return s(e,t,e=>i.push(r(e)),n),i}function u(e,t,r,{includeSelf:n,shouldSkipAfter:i,shouldBreakAfter:l}={}){let a;return s(e,t,e=>{r(e)&&(a=e)},{includeSelf:n,shouldSkipAfter:i,shouldBreakAfter:e=>null!=a||(null==l?void 0:l(e))||!1}),a}function c(e,t,r,n={}){let i=[];return s(e,t,e=>{r(e)&&i.push(e)},n),i}function d(e,t,r=l,n={}){let i=0;return s(e,t,e=>{r(e)&&i++},n),i}function h(e,t,r,n){return null!=u(a(e),t,r,n)}function p(e,t,r,n){return!h(a(e),t,e=>!r(e),n)}},956722:(e,t,r)=>{let n;r.d(t,{DB:()=>a,p7:()=>s,vu:()=>l});var i=r(794307);let l={NONE:"NONE",DOCUMENT:"DOC",CANVAS:"CANV",GROUP:"GROUP",FRAME:"FRAME",BOOLEAN_OPERATION:"BOOL",VECTOR:"VECT",STAR:"STAR",LINE:"LINE",ELLIPSE:"ELLPS",RECTANGLE:"RECT",REGULAR_POLYGON:"POLY",ROUNDED_RECTANGLE:"RRECT",TEXT:"TEXT",SLICE:"SLICE",SYMBOL:"SYMB",STATE:"STATE",PRIMARY_INSTANCE:"PINST",NESTED_INSTANCE:"NINST",STICKY:"STCKY",SHAPE_WITH_TEXT:"SWTXT",CONNECTOR:"CONN",CODE_BLOCK:"CODE",WIDGET:"WIDGT",STAMP:"STAMP",MEDIA:"MEDIA",HIGHLIGHT:"HIGH",SECTION:"SECT",SECTION_OVERLAY:"SECTO",WASHI_TAPE:"WASHI",STATE_GROUP:"STGRP",FILL_STYLE:"FSTYL",STROKE_STYLE:"SSTYL",TEXT_STYLE:"TSTYL",EFFECT_STYLE:"ESTYL",EXPORT_STYLE:"XSTYL",GRID_STYLE:"GSTYL",VARIABLE:"VAR",VARIABLE_COLLECTION:"V_COL",VARIABLE_OVERRIDE:"V_OVR",TABLE:"TABLE",TABLE_CELL:"TCELL",SLIDE:"SLIDE",SLIDE_ROW:"SROW",SLIDE_GRID:"SGRID",ASSISTED_LAYOUT:"ALAYO",INTERACTIVE_SLIDE_ELEMENT:"FLAPP",MODULE:"MOD"};var a=((n=a||{})[n.Grouping=0]="Grouping",n[n.Shape=1]="Shape",n[n.DesignSystems=2]="DesignSystems",n[n.ImmutableFrame=3]="ImmutableFrame",n[n.Media=4]="Media",n[n.Other=5]="Other",n);function s(e){switch(e){case"DOCUMENT":case"CANVAS":case"GROUP":case"FRAME":case"SECTION":case"TABLE_CELL":case"SLIDE":case"SLIDE_ROW":case"SLIDE_GRID":return 0;case"SYMBOL":case"STATE_GROUP":case"STATE":case"FILL_STYLE":case"STROKE_STYLE":case"TEXT_STYLE":case"EFFECT_STYLE":case"EXPORT_STYLE":case"GRID_STYLE":case"PRIMARY_INSTANCE":case"NESTED_INSTANCE":case"VARIABLE":case"VARIABLE_COLLECTION":case"VARIABLE_OVERRIDE":case"MODULE":return 2;case"BOOLEAN_OPERATION":case"VECTOR":case"STAR":case"LINE":case"ELLIPSE":case"RECTANGLE":case"REGULAR_POLYGON":case"ROUNDED_RECTANGLE":case"HIGHLIGHT":return 1;case"WIDGET":case"STAMP":case"WASHI_TAPE":case"INTERACTIVE_SLIDE_ELEMENT":return 4;case"STICKY":case"SHAPE_WITH_TEXT":case"CONNECTOR":case"CODE_BLOCK":case"MEDIA":case"SECTION_OVERLAY":case"TABLE":return 3;case"TEXT":case"NONE":case"SLICE":case"ASSISTED_LAYOUT":return 5;default:return(0,i.j)(e),5}}},961837:(e,t,r)=>{r.d(t,{H:()=>p});var n=r(758271),i=r.n(n),l=r(695614),a=r(77083),s=r(706243),o=r(938551),u=r(888887);class c extends u.R4{constructor(e,t){super(e.nodeChange),this.node=e,this.frozenParent=t??e.parent(),this.frozenChildren=e.children().map(e=>new c(e,this)),this.frozenAncestorPath=e.ancestorPath(),this.frozenNodeFieldProperties=e.nodeFieldProperties(),this.frozenComputedProperties=e.computedProperties(),this.frozenName=e.name(),this.frozenDisplayName=e.displayName(),this.frozenText=e.text(),this.frozenIconConfig=e.iconConfig(),this.frozenOrphan=e.isOrphan(),this.memoryUsage=e.memoryUsage,this.treeMemoryUsage=e.treeMemoryUsage}freeze(){return this}parent(){return this.frozenParent}children(){return this.frozenChildren}name(){return this.frozenName}displayName(){return this.frozenDisplayName}text(){return this.frozenText}iconConfig(){return this.frozenIconConfig}isOrphan(){return this.frozenOrphan}ancestorPath(){return this.frozenAncestorPath}generateNodeFieldProperties(){return this.frozenNodeFieldProperties}generateComputedProperties(){return this.frozenComputedProperties}backingSymbol(){return this.node.backingSymbol()}consumedStyles(){return this.node.consumedStyles()}consumedStyleIds(){return this.node.consumedStyleIds()}consumedVariables(){return this.node.consumedVariables()}consumedVariableIds(){return this.node.consumedVariableIds()}}var d=r(210106),h=r(438396);class p extends u.R4{constructor(e,t){super(e),this._scene=t}freeze(){return new c(this)}parent(){let e=this.parentGuid();return e?this._scene.getNode(e):null}children(){return this._scene.getChildren(this.guid())}internalOnly(){var e;return this.nodeChange.internalOnly||(null==(e=this.parent())?void 0:e.internalOnly())||!1}backingSymbol(){let e=this.backingSymbolId();return e?this._scene.getNode(e):null}backingStateGroup(){let e=this.backingSymbol();if(!e)return null;let t=e.parent();return t&&t.isStateGroup()?t.guidStr():null}generateNodeFieldProperties(){return Object.keys(this.nodeChange).sort().map(e=>{let t=this.nodeChange[e];return null==t?null:(0,h.oy)(e,t)}).filter(l.Vq)}isOrphan(){return!!this._scene.isFullFile()&&"DOCUMENT"!==this.nodeType()&&!this.parent()}name(){return this._name??(this._name=(0,o.b)(this.nodeChange.name??"",this._scene.sensitiveTextPolicy))}displayName(){return this._displayName??(this._displayName=(()=>{if("multiplayer_journal"!==this._scene.type)return this.name();let{editScopeInfo:e}=this.nodeChange,t=[];if(e){for(let r of e.snapshots??[])for(let e of r.frames??[])for(let r of e.stack??[])t.push(r);for(let r of e.editScopeStacks??[])for(let e of r.stack??[])t.push(e)}t=i()(t,e=>e.label);let r=["USER","PLUGIN"];return t.sort((e,t)=>Number(r.includes(e.label))-Number(r.includes(t.label))),t.map(e=>e.label).join(", ")||"No edit scopes"})())}text(){var e;return(0,o.b)((null==(e=this.nodeChange.textData)?void 0:e.characters)??"",this._scene.sensitiveTextPolicy)}iconConfig(){return this._scene.shouldShowNodePhases&&this._scene.shouldShowNodeTypes?{phase:this.phase(),type:this.type()}:this._scene.shouldShowNodePhases?this.phase():this.type()}absoluteTransform(){var e;let t=this.transform(),r=null==(e=this.parent())?void 0:e.absoluteTransform();if(!t||!r)return s.s.identity().toFigMatrix();{let e=s.s.fromFigMatrix(r);return e.multiply(s.s.fromFigMatrix(t)),e.toFigMatrix()}}styleConsumers(){let e=this.styleId();return e?this._scene.getStyleConsumers(e):[]}variableConsumers(){let e=this.variableId();return e?this._scene.getVariableConsumers(e):[]}variablesInCollection(){let e=this.variableCollectionId();return e?this._scene.getVariablesInCollection(e):[]}variablesDirectlyDependedOnByThisVariable(){var e,t;if(!this.isVariable())return{};let r={},n=this._scene,i=n.getVariableCollection(this.variableCollectionId());return null==(t=null==(e=this.nodeChange.variableDataValues)?void 0:e.entries)||t.forEach(e=>{if(e.modeID){let t=(null==i?void 0:i.getFriendlyVariableModeString(e.modeID))??(0,d.qJ)(e.modeID);r[t]=[],function e(t,i){if((null==i?void 0:i.dataType)==="ALIAS")!function(e,t){var i;if(!(null==(i=null==t?void 0:t.value)?void 0:i.alias))return;let l=a.sD.fromKiwi(t.value.alias);if(!l)return;let s=n.getVariable(l);s&&r[e].push(s)}(t,i);else if((null==i?void 0:i.dataType)==="EXPRESSION")!function(t,r){var n,i;for(let l of(null==(i=null==(n=null==r?void 0:r.value)?void 0:n.expressionValue)?void 0:i.expressionArguments)??[])e(t,l)}(t,i);else if((null==i?void 0:i.dataType)==="MAP")return function(t,r){var n,i;for(let l of(null==(i=null==(n=null==r?void 0:r.value)?void 0:n.mapValue)?void 0:i.values)??[])e(t,l.value)}(t,i)}(t,e.variableData)}}),r}}},291909:(e,t,r)=>{let n;r.d(t,{M2:()=>h,ZV:()=>c,hy:()=>o,iE:()=>m,wC:()=>u});var i=r(617618),l=r(77083),a=r(670122),s=r(186269),o=((n=o||{}).BlobIndex="BlobIndex",n.SensitiveText="SensitiveText",n.Boolean="Boolean",n.Numeric="Numeric",n.String="String",n.Position="Position",n.Color="Color",n.Vector="Vector",n.NodeId="NodeId",n.StyleId="StyleId",n.VariableId="VariableId",n.VariableCollectionId="VariableCollectionId",n.OverrideKey="OverrideKey",n.OverridePath="OverridePath",n.GenericGuid="GenericGuid",n.GenericGuidPath="GenericGuidPath",n.GenericGuidPathMapping="GenericGuidPathMapping",n.Matrix="Matrix",n.ImageHash="ImageHash",n.Bytes="Bytes",n.Metadata="Metadata",n.Error="Error",n.Image="Image",n.EditScope="EditScope",n);function u(e,t,r){var n,o;if((0,a.M_)(t,e))return{type:"BlobIndex",value:t};if((0,a.sX)(t,e))return{type:"SensitiveText",value:t};if((0,a.Lm)(t))return{type:"Boolean",value:t};if((0,a.kf)(t))return{type:"Numeric",value:t};if((0,a.Kg)(t))return("position"===e||"sortPosition"===e)&&(0,i.qO)(t)?{type:"Position",value:t}:{type:"String",value:t};if((0,a._o)(t))return{type:"Color",value:t};if((0,a.WX)(t))return{type:"Vector",value:t};if((0,s.ar)(e)){let e=l.PK.fromKiwi(t);if(e)return{type:"StyleId",value:e}}if("variableSetID"===e){let e=l.gr.fromKiwi(t);if(e)return{type:"VariableCollectionId",value:e}}if("id"===e||"alias"===e){let e=l.sD.fromKiwi(t);if(e)return{type:"VariableId",value:e}}if((0,a.W_)(t))return"symbolID"===e||"overriddenSymbolID"===e||"endpointNodeID"===e||(0,s.Z7)(e)||"guid"===e&&"diagramParentIndex"===r?{type:"NodeId",value:t}:{type:"GenericGuid",value:t};if((0,a.hV)(t)){let{guids:e}=t;return e?{type:"GenericGuidPath",value:e}:{type:"Error",value:"Invalid Fig.GUIDPath"}}if((0,a.VL)(t)){let e=t.id,r=null==(n=null==t?void 0:t.path)?void 0:n.guids;return e&&r?{type:"GenericGuidPathMapping",from:t.id,to:null==(o=t.path)?void 0:o.guids}:{type:"Error",value:"Invalid Fig.GUIDPathMapping"}}return(0,a.OA)(t)?{type:"Matrix",value:t}:(0,a.qx)(t,e)?{type:"ImageHash",value:t}:(0,a.aY)(t)?{type:"Bytes",value:t}:(0,a.Rt)(t)?{type:"EditScope",value:t}:void 0}function c(e){return"bigint"==typeof e||e%1==0?e.toString():e.toFixed(4)}let d={String:function(e){return e.value},Numeric:function(e){return c(e.value)},Vector:function(e){return c(e.value.x)+", "+c(e.value.y)}};function h(e){if(!e||!e.type)return"";let t=d[e.type];return t?t(e):(console.warn("No plaintext formatter implemented yet for property type: "+e.type),"")}let p={String:function(e){return{type:"String",value:e}},Numeric:function(e){let t=parseFloat(e);return isNaN(t)?null:{type:"Numeric",value:t}},Vector:function(e){let[t,r]=e.split(",").map(e=>parseFloat(e));return t&&r&&!isNaN(t)&&!isNaN(r)?{type:"Vector",value:{x:t,y:r}}:null}};function m(e,t){if(!e||!t)return null;let r=p[t];return r?r(e):(console.warn("No FigmaScopeValue formatter implemented yet for property type: "+t),null)}},438396:(e,t,r)=>{r.d(t,{Jt:()=>B,Lk:()=>N,Oj:()=>k,PS:()=>w,PT:()=>A,Ro:()=>U,SP:()=>O,St:()=>C,VX:()=>g,Wh:()=>R,_9:()=>I,az:()=>b,cT:()=>_,dL:()=>x,dW:()=>D,f3:()=>V,fG:()=>v,gq:()=>T,lh:()=>L,nn:()=>E,oy:()=>y,q7:()=>P,qU:()=>f,sq:()=>m,tN:()=>M,w_:()=>G,x9:()=>F});var n=r(611464),i=r(963039),l=r(695614),a=r(77083),s=r(183518),o=r(742900),u=r(670122),c=r(924072),d=r(210106),h=r(888887),p=r(291909);function m(e){return B("FigmaScope type",{type:p.hy.String,value:e})}function f(e,t){if(!e.isAsset())return null;let r=e.isSubscribedAsset(),i=[B("Status",{type:p.hy.String,value:r?"Subscribed":"Local"}),B("Key",{type:p.hy.String,value:t??e.key()??"[not computed]"}),B("Version",{type:p.hy.String,value:e.version()??"[unknown]"})];return r&&!(0,n.kc)().ds_publish_file_deprecation&&i.push(B("File",{type:p.hy.String,value:e.publishFile()??"[unknown]"})),{label:"Asset info",children:i,expandByDefault:!1}}function y(e,t,r){let n=(0,p.wC)(e,t,r);if(null!=n)return B(e,n);if(Array.isArray(t))return G({label:e,list:t,buildChild:(e,t)=>y(e,t),expandByDefault:!1});{let r=["connectorStart","connectorEnd","symbolData"].includes(e);return M({label:e,object:t,buildChild:(t,r)=>y(t,r,e),expandByDefault:r})}}function g(e){let t=e.backingSymbol();return t?L("Backing symbol",t):B("Backing symbol ID",{type:p.hy.Error,value:"MISSING"})}function v(e){var t;let r=null==(t=e.backingSymbol())?void 0:t.parent();return r&&r.isStateGroup()?L("Backing state group",r):null}function E(e){return G({label:"Other versions",list:e,buildChild:L,expandByDefault:!1})}function S(e,t,r){return G({label:e,list:[...t].sort((e,t)=>{var r,n,i,l;if(((null==(n=null==(r=e.guidPath)?void 0:r.guids)?void 0:n.length)??0)===((null==(l=null==(i=t.guidPath)?void 0:i.guids)?void 0:l.length)??0)){if("overriddenSymbolID"in e)return -1;if("overriddenSymbolID"in t)return 1;if("componentPropAssignments"in e)return -1;if("componentPropAssignments"in t)return 1}return function(e,t){let r=e.guids??[],n=t.guids??[];for(let e=0;e<Math.min(r.length,n.length);e++){let t=r[e],i=n[e];if(t.sessionID!==i.sessionID)return t.sessionID-i.sessionID;if(t.localID!==i.localID)return t.localID-i.localID}return r.length-n.length}(e.guidPath||{},t.guidPath||{})}),buildChild:(e,{guidPath:t,...n})=>{let i=null==t?void 0:t.guids,l=i?r.followOverridePath(i):void 0;return M({label:e,value:i?{type:p.hy.OverridePath,value:i,targetGuid:null==l?void 0:l.guid()}:{type:p.hy.Error,value:"No override path"},object:n,buildChild:(e,t)=>null==t?null:y(e,t),expandByDefault:!0})},expandByDefault:!1})}function b(e){let t=e.overridesList();return 0===t.length?null:S("Instance overrides",t,e)}function I(e){let t=e.derivedOverridesList();return 0===t.length?null:S("Instance derived symbol data",t,e)}function C(e,t){let r=e.immutableFrameSublayerOverridesList();return 0===r.length?null:G({label:"Sublayer path overrides",list:r,buildChild:(e,{guidPath:r,...n})=>{var i,l;let a;let s=null==r?void 0:r.guids,o=`[${null==(i=null==s?void 0:s.map(e=>(0,d.qJ)(e)))?void 0:i.join(", ")}]`;if(t.has(o)){let e=null==(l=t.get(o))?void 0:l.sublayerGuid,r=e?(0,d.wr)(e):void 0;r&&(a=r)}return M({label:e,value:s?{type:p.hy.OverridePath,value:s,targetGuid:a}:{type:p.hy.Error,value:"No override path"},object:n,buildChild:(e,t)=>null==t?null:y(e,t),expandByDefault:!0})},expandByDefault:!1})}function T(e,t){return M({label:"Sublayer path override from containing immutable frame",object:t,buildChild:(e,t)=>null==t?null:y(e,t),expandByDefault:!0})}function N(e){return function({label:e,object:t,buildChild:r,expandByDefault:n}){let i=Object.keys(t).sort().map(e=>r(e,t[e])).filter(l.Vq);return{label:e,value:{type:p.hy.Metadata,value:i.length},children:i,expandByDefault:n}}({label:"Text insertion style",object:e,buildChild:(e,t)=>null==t?null:y(e,t),expandByDefault:!0})}function _(e){return G({label:"Style consumers",list:e,buildChild:L,expandByDefault:!1})}function D(e){return L("Variable collection",e)}function x(e){return G({label:"Variable consumers",list:e,buildChild:L,expandByDefault:!1})}function A(e){return G({label:"Consumed variables",list:e,buildChild:L,expandByDefault:!1})}function O(e){return G({label:"Variables",list:e,buildChild:L,expandByDefault:!1})}function w(e){return G({label:"Direct dependents on this variable",list:e,buildChild:L,expandByDefault:!1})}function P(e){return M({label:"Variable direct dependencies",object:e,buildChild:(e,t)=>G({label:e,list:t,buildChild:L,expandByDefault:!1}),expandByDefault:!1})}function k(e){return G({label:"Consumed styles",list:e,buildChild:L,expandByDefault:!1})}function R(e){return G({label:"SceneGraph validation errors",list:e,buildChild:(e,t)=>B(e,{type:p.hy.Error,value:t}),expandByDefault:!0})}function F(e){return M({label:"Chunk details",object:e.chunk,buildChild:y,expandByDefault:!1})}function V(e){let t=new c._;for(let[r,n]of e.entries())for(let e of n)t.add(e,r);return[...t.values()].forEach(e=>e.sort()),G({label:"SceneGraph validation errors (Whole File)",list:[...t.entries()],buildChild:(e,[t,r])=>G({label:t,list:r,buildChild:L,expandByDefault:!0}),expandByDefault:!0})}function L(e,t){if(t instanceof h.R4){let r=t.isStyle()?t.styleId():void 0;if(r)return L(e,r);let n=t.isVariable()?t.variableId():void 0;if(n)return L(e,n);let i=t.isVariableCollection()?t.variableCollectionId():void 0;return i?L(e,i):L(e,t.guid())}if("string"==typeof t){let r=a.PK.fromString(t);if(r)return B(e,{type:p.hy.StyleId,value:r});let n=a.sD.fromString(t);if(n)return B(e,{type:p.hy.VariableId,value:n});let i=a.gr.fromString(t);if(i)return B(e,{type:p.hy.VariableCollectionId,value:i});let l=(0,d.wr)(t)??s.Hr;return B(e,{type:p.hy.NodeId,value:l})}return B(e,{type:p.hy.NodeId,value:t})}function B(e,t,r){return{label:e,value:t,children:[],expandByDefault:!1,onEdit:r}}function G({label:e,value:t,list:r,buildChild:n,expandByDefault:i}){return{label:e,value:t??{type:p.hy.Metadata,value:r.length},children:r.map((e,t)=>{var r;let i=n(`[${t}]`,e,t);return(0,u.jn)(e)&&i?{...i,value:{type:p.hy.OverridePath,value:null==(r=e.guidPath)?void 0:r.guids}}:i}).filter(l.Vq),expandByDefault:i}}function M({label:e,value:t,object:r,buildChild:n,expandByDefault:i}){return{label:e,value:t,children:Object.keys(r).sort().map(e=>n(e,r[e])).filter(l.Vq),expandByDefault:i}}function U(e,t,r,n){let l={x:t.m02,y:t.m12},a=t.m00*t.m11-t.m01*t.m10,s=Math.atan2(t.m10,t.m00)*(180/Math.PI);s=(0,i.xN)(s,0,1e-4)?0:-1*s;let u="No";a<0&&(u=(0,i.xN)(s,0,1e-4)?"Vertically":(0,i.xN)(Math.abs(s),180,1e-4)?"Horizontally":"Yes");let c=r&&n;return{label:e,children:[B("Offset",{type:p.hy.Vector,value:l},c?e=>{let t=o.qo.instance.get(n);t&&(t.relativeTransform={...t.relativeTransform,m02:e.value.x,m12:e.value.y})}:void 0),B("Angle",{type:p.hy.Numeric,value:s},c?e=>{let t=o.qo.instance.get(n);if(!t)return;let r=e.value*(Math.PI/180),i=Math.sin(r),l=Math.cos(r),{m00:a,m01:s,m02:u,m10:c,m11:d,m12:h}=t.relativeTransform;t.relativeTransform={m00:l*a+i*s,m01:l*s-i*a,m02:u,m10:l*c+i*d,m11:l*d-i*c,m12:h}}:void 0),B("Scale",{type:p.hy.Numeric,value:a}),B("Mirrored",{type:p.hy.String,value:u})],expandByDefault:!0}}},999275:(e,t,r)=>{r.d(t,{X:()=>s});var n=r(297557),i=r(210106),l=r(888887),a=r(262919);class s{constructor({resource:e,sensitiveTextPolicy:t}){this._shouldShowNodeTypes=!0,this._shouldShowNodePhases=!1,this.resource=e,this.sensitiveTextPolicy=t,window.figmaScopeScene=this}get type(){return this.resource.type}isFullFile(){return(0,n.GP)(this.type)}get shouldShowNodeTypes(){return this._shouldShowNodeTypes}get shouldShowNodePhases(){return this._shouldShowNodePhases}getPages(){return this.filterNodes(e=>"CANVAS"===e.nodeType(),{shouldSkipAfter:e=>"CANVAS"!==e.nodeType()})}getInternalCanvas(){return this.getPages().find(e=>e.isInternalOnly())}forEachNode(e,t={}){return(0,a.zV)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}mapNodes(e,t={}){return(0,a.o6)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}filterNodes(e,t={}){return(0,a.is)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}findNode(e,t={}){return(0,a.cy)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}countNodes(e,t={}){return(0,a.d8)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}someNode(e,t={}){return(0,a.Ng)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}everyNode(e,t={}){return(0,a.AH)(this.getRootNodes(),l.i0,e,{...t,includeSelf:!0})}guidToString(e){return(0,i.qJ)(e)}}},186269:(e,t,r)=>{r.d(t,{GP:()=>l,Z7:()=>a,ar:()=>s,ux:()=>i});var n=r(794307);let i=new Set(["inheritFillStyleID","inheritFillStyleIDForStroke","inheritGridStyleID","inheritTextStyleID","inheritEffectStyleID"]),l=new Set(["styleIdForFill","styleIdForStrokeFill","styleIdForText","styleIdForEffect","styleIdForGrid"]);function a(e){return i.has(e)}function s(e){return l.has(e)}(0,n.j)(i),(0,n.j)(l)},783161:(e,t,r)=>{r.d(t,{V:()=>b});var n=r(677469),i=r.n(n),l=r(169614),a=r(682438),s=r(77083),o=r(183518),u=r(956722),c=r(924072);class d{constructor(){this.children=new Map,this.value=[]}}class h{constructor(){this.root=new d}insert(e,t){let r=this.root;for(let t=0;t<e.length;t++){let n=e.charAt(t),i=r.children.get(n);i||r.children.set(n,i=new d),r=i}r.value.push(t)}prefixFind(e){let t=[];for(let r of this.keysWithPrefix(e)){let e=this.find(r);if(e)for(let r of e)t.push(r)}return t}find(e){let t=this.root;for(let r=0;r<e.length;r++){let n=e.charAt(r),i=t.children.get(n);if(!i)return;t=i}return t.value}keysWithPrefix(e){let t=[],r=this.findNode(e);return this.collect(r,function(e){let t=[];for(let r=0;r<e.length;r++){let n=e.charAt(r);t.push(n)}return t}(e),t),t}collect(e,t,r){if(e)for(let n of(e.value.length>0&&r.push(t.join("")),Array.from(e.children.keys())))t.push(n),this.collect(e.children.get(n),t,r),t.pop()}findNode(e){let t=this.root;for(let r=0;r<e.length;r++){let n=e.charAt(r),i=t.children.get(n);if(!i)return;t=i}return t}}var p=r(425631);class m{constructor({property:e,aliases:t=[]}){this.property=e,this.aliases=t}getValues(e){let t=e[this.property]();return Array.isArray(t)?t:null!=t?[t]:[]}indexNode(e){for(let t of this.getValues(e))this.indexEntry({property:this.property,value:t,node:e})}}class f extends m{constructor(){super(...arguments),this.byKey=new c._}indexEntry(e){let t=e.value.toLowerCase();this.byKey.add(t,e)}search(e){return this.byKey.get(e.rawValue.toLowerCase()).map(e=>({...e,isExact:!0}))}}class y extends m{constructor(){super(...arguments),this.trie=new h}indexEntry(e){this.trie.insert(e.value.toLowerCase(),e)}search(e){if(e.type===p.V.STRICT_STRING)return(this.trie.find(e.value.toLowerCase())??[]).filter(t=>t.value===e.value).map(e=>({...e,isExact:!0}));{let t=String(e.value);return this.trie.prefixFind(t.toLowerCase()).map(e=>({...e,isExact:e.value===t}))}}}class g extends m{constructor(){super(...arguments),this.bySessionId=new c.d,this.byLocalId=new c.d}indexEntry(e){let{sessionID:t,localID:r}=e.value;this.bySessionId.add(t,e),this.byLocalId.add(r,e)}search(e){if(e.type===p.V.GUID)return this.searchGuid(e.value);if(e.type===p.V.INT)return this.searchInt(e.value);if(e.type===p.V.ASSET_REF)return this.searchRef(e.value);if(e.type===p.V.ASSET_ID){let t=e.fns.toGuidObjIfLocal(e.value);if(t)return this.searchGuid(t);let r=e.fns.toRefIfSubscribed(e.value);if(r)return this.searchRef(r)}return[]}searchGuid(e){return Array.from((0,a.iR)(this.bySessionId.get(e.sessionID),this.byLocalId.get(e.localID))).map(e=>({...e,isExact:!0}))}searchRef(e){let t=o.sH(e.version);return t?this.searchGuid(t):[]}searchInt(e){return Array.from((0,a.gG)(this.bySessionId.get(e),this.byLocalId.get(e))).map(e=>({...e,isExact:!1}))}}class v extends m{constructor({assetIdFns:e,...t}){super(t),this.byAssetId=new c._,this.bySessionId=new c.d,this.byLocalId=new c.d,this.byKey=new c.d,this.byVersion=new c.d,this.assetIdFns=e}indexEntry(e){this.byAssetId.add(e.value,e);let t=this.assetIdFns.toGuidObjIfLocal(e.value);t&&(this.bySessionId.add(t.sessionID,e),this.byLocalId.add(t.localID,e));let r=this.assetIdFns.toRefIfSubscribed(e.value);r&&(this.byKey.add(r.key,e),this.byVersion.add(r.version,e))}search(e){return e.type===p.V.ASSET_ID?this.searchAssetId(e.value):e.type===p.V.GUID?this.searchGuid(e.value,e.rawValue):e.type===p.V.ASSET_REF?this.searchRef(e.value):e.type===p.V.INT?this.searchInt(e.value):[]}searchAssetId(e){return this.byAssetId.get(e).map(e=>({...e,isExact:!0}))}searchGuid(e,t){let r=Array.from((0,a.iR)(this.bySessionId.get(e.sessionID),this.byLocalId.get(e.localID))).map(e=>({...e,isExact:!0})),n=Array.from(this.byVersion.get(t)).map(e=>({...e,isExact:!1}));return r.concat(n)}searchRef(e){return Array.from((0,a.iR)(this.byKey.get(e.key),this.byVersion.get(e.version))).map(e=>({...e,isExact:!0}))}searchInt(e){return Array.from((0,a.gG)(this.bySessionId.get(e),this.byLocalId.get(e))).map(e=>({...e,isExact:!1}))}}class E extends y{constructor(){super({property:"type",aliases:["type","nodeType"]})}getValues(e){let t=e.type();return[t,u.vu[t],e.nodeType()]}}class S extends f{search(e){return e.type!==p.V.HEX_KEY&&e.type!==p.V.INT?[]:super.search(e)}}class b{constructor(){this.indices=[new g({property:"guid",aliases:["id","nodeId"]}),new g({property:"parentGuid",aliases:["parent"]}),new g({property:"overrideKey",aliases:["okey"]}),new g({property:"backingSymbolId",aliases:["symbol","symbolId"]}),new g({property:"publishId"}),new g({property:"consumedStyleIds",aliases:["consumedStyleId","consumedStyle","consumedStyles"]}),new y({property:"name"}),new y({property:"text"}),new E,new S({property:"key"}),new f({property:"version",aliases:["assetVersion","sharedSymbolVersion"]}),new S({property:"publishFile"}),new S({property:"imageHashes"}),new v({assetIdFns:s.Ws,property:"symbolId",aliases:["symbol"]}),new v({assetIdFns:s.GU,property:"stateGroupId",aliases:["stateGroup"]}),new v({assetIdFns:s.PK,property:"styleId",aliases:["style"]}),new v({assetIdFns:s.sD,property:"variableId",aliases:["variable"]}),new v({assetIdFns:s.gr,property:"variableCollectionId",aliases:["variableSetId","collectionId","variableCollection","variableSet"]})]}indexNode(e){for(let t of this.indices)t.indexNode(e)}indexNodes(e){for(let t of this.indices)for(let r of e)t.indexNode(r)}search(e,t){let r=(0,p._)(e,t);l.az.trackDefinedEvent("figmascope.search",{used_operators:r.length>1||null!=r[0].property});let n=this.searchTokens(r);return n.sort(b.compareResults),n}searchTokens(e){let t;for(let r of e){let e=new Map;for(let t of this.getIndicesToSearchForToken(r))for(let n of t.search(r.value)){let{node:t,property:r,value:i,isExact:l}=n;e.has(t)?e.get(t).matches.push({property:r,value:i,isExact:l}):e.set(t,{node:t,matches:[{property:r,value:i,isExact:l}]})}t=t?(0,a.wD)(t,e,(e,t,r)=>({node:e,matches:t.matches.concat(r.matches)})):e}return t?i()(Array.from(t.values())):[]}get indexedProperties(){return this.indices.map(e=>e.property)}getIndicesToSearchForToken({property:e}){return null==e?this.indices.filter(e=>"parentGuid"!==e.property):(e=e.toLowerCase(),this.indices.filter(t=>{if(t.property.toLowerCase()===e)return!0;for(let r of t.aliases)if(r.toLowerCase()===e)return!0;return!1}))}static compareResults(e,t){let r=e.matches.filter(e=>e.isExact).length;return t.matches.filter(e=>e.isExact).length-r||t.matches.length-e.matches.length}}},425631:(e,t,r)=>{let n;r.d(t,{V:()=>s,_:()=>o});var i=r(77083),l=r(62385),a=r(183518),s=((n=s||{}).GUID="GUID",n.ASSET_REF="ASSET_REF",n.ASSET_ID="ASSET_ID",n.INT="INT",n.HEX_KEY="HEX_KEY",n.LOOSE_STRING="LOOSE_STRING",n.STRICT_STRING="STRICT_STRING",n);function o(e,t){var r;let n;let s=[];e=e.trim();let o=/([a-zA-Z0-9_.]+=)?("[^"]*"|'[^']*'|[^\s]+)/g;for(;n=o.exec(e);){let e=(null==(r=n[1])?void 0:r.slice(0,-1))||void 0,t=function(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return{type:"STRICT_STRING",value:e=e.slice(1,-1),rawValue:e};let t=(0,a.sH)(e);if(t)return{type:"GUID",value:t,rawValue:e};let r=i.Ws.fromString(e);if(r)return{type:"ASSET_ID",value:r,fns:i.Ws,rawValue:e};let n=i.GU.fromString(e);if(n)return{type:"ASSET_ID",value:n,fns:i.GU,rawValue:e};let s=i.PK.fromString(e);if(s)return{type:"ASSET_ID",value:s,fns:i.PK,rawValue:e};let o=i.sD.fromString(e);if(o)return{type:"ASSET_ID",value:o,fns:i.sD,rawValue:e};let u=i.gr.fromString(e);if(u)return{type:"ASSET_ID",value:u,fns:i.gr,rawValue:e};let c=l.iU.fromString(e);if(c)return{type:"ASSET_REF",value:c,rawValue:e};if(/^\d+$/.test(e)){let t=parseInt(e);if(!isNaN(t))return{type:"INT",value:t,rawValue:e}}return/^[0-9a-fA-F]+$/.test(e)?{type:"HEX_KEY",value:e,rawValue:e}:{type:"LOOSE_STRING",value:e,rawValue:e}}(n[2]);s.push({property:e,value:t})}return s.length>1&&(s=function(e){let t=[],r=e[0],n=e[1],i=2;for(;;)if(n){if(r.property||n.property||"STRICT_STRING"===r.value.type||"STRICT_STRING"===n.value.type)t.push(r),r=n,n=e[i++];else{let t=`${r.value.rawValue} ${n.value.rawValue}`;r={property:void 0,value:{type:"LOOSE_STRING",value:t,rawValue:t}},n=e[i++]}}else{t.push(r);break}return t}(s)),s=function(e,t){let r=(0,a.sH)(t);return r?e.map(e=>"LOOSE_STRING"===e.value.type&&"$0"===e.value.rawValue?{property:e.property,value:{type:"GUID",value:r,rawValue:e.value.rawValue}}:e):e}(s,t)}},715775:(e,t,r)=>{let n,i;r.d(t,{Oz:()=>p,VT:()=>g,ok:()=>c,s3:()=>f,sg:()=>m,tE:()=>y,zy:()=>d});var l=r(169614),a=r(38580),s=r(732326),o=r(529886),u=r(197992),c=((n=c||{}).None="No Diff",n.Layer="Layer Diff",n.Tree="Tree Diff",n.File="File Diff",n);let d=(0,a.eU)(null);function h(e){return"Layer Diff"===e?"layer":"tree"}let p=(0,s.FZ)((0,a.eU)(null),(e,t,r)=>{var n;let i,a;let s=new Date;if("clear"===t.type)return e&&l.az.trackDefinedEvent("figmascope.diff_end",{type:h(e.type),duration_seconds:(s.getTime()-e.time.getTime())/1e3}),null;if("start"===t.type?(i=t.guidStr,a=t.diffType):"refresh"===t.type&&e&&(i=e.node.guidStr(),a=e.type),!i||!a)return null;let u=null==(n=r(o.AC).getNode(i))?void 0:n.freeze();return u?(l.az.trackDefinedEvent("figmascope.diff_start",{type:h(a)}),{type:a,node:u,time:new Date}):null}),m=(0,a.eU)(e=>{let t=e(d);return t?{type:"File Diff",scene:t}:e(p)??{type:"No Diff"}}),f=(0,a.eU)(e=>{let t=e(u.Nq),r=e(m);switch(r.type){case"Layer Diff":return r.node;case"Tree Diff":{let e=null==t?void 0:t.treeDiffKey();return r.node.findDescendant(t=>t.treeDiffKey()===e,{includeSelf:!0})??null}case"File Diff":{let e=null==t?void 0:t.treeDiffKey();return r.scene.findNode(t=>t.treeDiffKey()===e)}default:return null}});var y=((i=y||{}).Changed="CHANGED",i.ChildChanged="CHILD_CHANGED",i.Added="ADDED",i.Removed="REMOVED",i);function g(e,t,r,n){return e?t?r?"CHANGED":n?"CHILD_CHANGED":void 0:"ADDED":"REMOVED"}},529886:(e,t,r)=>{r.d(t,{AC:()=>d,Ah:()=>h,BJ:()=>p,XM:()=>c,_V:()=>u,o3:()=>o,zm:()=>m});var n=r(794307),i=r(2783),l=r(38580),a=r(288706),s=r(747019);let o=(0,l.eU)((0,i.Ok)()),u=(0,a.mg)(o,e=>"SUCCESS"===e.status?e.value.scenes.length:0),c=(0,l.eU)(0),d=(0,l.eU)(e=>{let t=e(o),r=e(c);if(t.status!==s.r.SUCCESS)throw Error("FigmaScope internal code is running before the FigmaScope scene is ready. This is a bug - please report in #figmascope.");return t.value.scenes[r]}),h=(0,a.mg)(o,e=>"SUCCESS"===e.status?e.value.resource:null),p=(0,a.mg)(h,e=>e?function(e){switch(e.type){case"server_file":return{type:"File",properties:{"File Key":e.key}};case"server_checkpoint":return{type:"File checkpoint",properties:{"Checkpoint Key":e.key}};case"server_checkpoint_diff":return{type:"Branching Checkpoint Diff",properties:{"Diff Key":e.key}};case"multiplayer_journal":return{type:"Multiplayer journal",properties:{"File key":e.fileKey,"End sequence number":e.endSequenceNumber??""}};case"multiplayer_journals":return{type:"Multiplayer journals",properties:{"File key":e.fileKey,"Start sequence number":e.startSequenceNumber??"","End sequence number":e.endSequenceNumber??""}};case"local_file":return{type:"Local .fig File",properties:{Filename:e.name}};case"local_diff_file":return{type:"Local .figd File",properties:{Filename:e.name}};case"pasted_data":return{type:"Pasted data",properties:{}};default:(0,n.xb)(e)}}(e):{type:"None",properties:{}}),m=(0,a.mg)(d,e=>e.getRootNodes())},197992:(e,t,r)=>{r.d(t,{AJ:()=>g,JN:()=>f,Nq:()=>v,Sd:()=>y,bA:()=>h,f:()=>d,hh:()=>S,jI:()=>m,vj:()=>E});var n=r(411855),i=r(202980),l=r(38580),a=r(732326),s=r(131350),o=r(210106),u=r(529886),c=r(385477);let d=n.createContext(null),h=(0,l.eU)(e=>e(c.l).followSelection,(e,t,r)=>t(c.l,e=>({...e,followSelection:r}))),{valueAtom:p,undoAtom:m,redoAtom:f,historyAtom:y}=(0,a.xP)("0:0"),g=(0,l.eU)(e=>e(p),(e,t,r)=>{let n=(0,o.SR)(r);n&&t(p,n)}),v=(0,l.eU)(e=>{let t=e(u.AC),r=e(g);return t.getNode(r)});function E({appSelection:e,setAppSelection:t}){let r=(0,a.md)(u.AC),l=(0,a.md)(h),[o,c]=(0,a.fp)(g);n.useEffect(()=>{s.Y5.setFigmascopeSelectedGuidCallback(c)},[c]);let d=o?r.getNode(o):null,p=(0,i.k9)(()=>d?S(d):null,[d]);n.useEffect(()=>{l&&t&&p&&t(p)},[l,t,p]),n.useEffect(()=>{l&&(null==e?void 0:e.guidStr)&&c(e.guidStr)},[l,null==e?void 0:e.guidStr,c])}function S(e){if(!e.isInternalOnly())return{selectionType:"canvas",guidStr:e.guidStr()};if(e.isStyle()&&e.isLocalAsset()){let t=e.nodeChange.styleType;if(t)return{selectionType:"local_style",guidStr:e.guidStr(),styleType:t}}return null}},385477:(e,t,r)=>{let n;r.d(t,{h:()=>l,l:()=>a});var i=r(732326),l=((n=l||{}).Position="Position",n.Name="Name",n.Memory="Memory",n.NodeId="Node ID",n);let a=(0,i.E3)("figmascope-settings",{followSelection:!1,sortOrder:"Position"})},670122:(e,t,r)=>{r.d(t,{Kg:()=>y,Lm:()=>m,M_:()=>d,OA:()=>s,Rt:()=>g,VL:()=>h,WX:()=>o,W_:()=>a,_o:()=>i,aY:()=>u,hV:()=>l,jn:()=>p,kf:()=>f,qx:()=>c,sX:()=>v});var n=r(938551);function i(e){return["r","g","b","a"].every(t=>t in e)}function l(e){return"guids"in e&&e.guids instanceof Array&&e.guids.every(a)}function a(e){return["sessionID","localID"].every(t=>t in e)}function s(e){return["m00","m01","m02","m10","m11","m12"].every(t=>t in e)}function o(e){return["x","y"].every(t=>t in e)}function u(e){return e instanceof Uint8Array}function c(e,t){return e instanceof Uint8Array&&"hash"===t}function d(e,t){return"number"==typeof e&&("commandsBlob"===t||"dataBlob"===t)}function h(e){return"id"in e&&"path"in e&&a(e.id)&&l(e.path)}function p(e){return"object"==typeof e&&"guidPath"in e&&l(e.guidPath)}function m(e){return"boolean"==typeof e}function f(e){return"number"==typeof e||"bigint"==typeof e}function y(e){return"string"==typeof e}function g(e){return"object"==typeof e&&"type"in e&&"label"in e}function v(e,t){return"string"==typeof e&&n.w.has(t)}},924072:(e,t,r)=>{r.d(t,{_:()=>i,d:()=>l});class n{constructor(){this.map=new Map}has(e){return this.map.has(e)}get size(){return this.map.size}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}}class i extends n{constructor(e){if(super(),e)for(let t of e)this.add(t[0],t[1])}add(e,t){this.has(e)?this.map.get(e).push(t):this.map.set(e,[t])}get(e){return this.map.get(e)??[]}}class l extends n{constructor(e){if(super(),e)for(let t of e)this.add(t[0],t[1])}add(e,t){this.has(e)?this.map.get(e).add(t):this.map.set(e,new Set([t]))}get(e){return this.map.get(e)??new Set}}},524403:(e,t,r)=>{r.d(t,{e:()=>n});let n="https://go/figmascope-docs"},938551:(e,t,r)=>{r.d(t,{b:()=>l,w:()=>n});let n=new Set(["name","characters","symbolDescription","description","url"]),i=RegExp("^(background|circle|column|component|dialog|document|ellipse|frame|group|icon|image|internal only canvas|line|padding|page|path|polygon|rectangle|row|star|text|union|vector)\\s*[\\d\\.]*$");function l(e,t){if(""===e)return"";if("show"===t)return e;let r='"'===e[0]&&'"'===e[e.length-1],n=r?e.substring(1,e.length-1):e;if(i.test(n.toLowerCase()))return e;let l=r?'"':"";return l+n[0]+n.substring(1,n.length-1).replace(/\S/g,"\u2022")+n[n.length-1]+l}},131127:(e,t,r)=>{r.d(t,{rf:()=>a,tV:()=>s,zG:()=>l});var n=r(411855),i=r(43594);function l(){return n.createElement(s,null,n.createElement("p",null,"Reading file..."))}function a({error:e}){let t="Oops! Something went wrong";return"string"==typeof e?t=e:e instanceof Error&&(t=e.message,console.error(e)),n.createElement(s,null,n.createElement("p",{style:i.sx.colorTextOndanger.colorBgDanger.p16.font20.$},t))}function s({children:e}){return n.createElement("div",{style:i.sx.fillPositionedContainer.flex.itemsCenter.justifyCenter.flexColumn.lh1_5Lines.font16.$},e)}},127692:(e,t,r)=>{let n,i,l;r.d(t,{J:()=>rA});var a=r(411855),s=r(169614),o=r(794307),u=r(71306),c=r(536006),d=r(732326),h=r(646240),p=r(272078),m=r(747019),f=r(304913),y=r(959875),g=r(43594),v=r(162122),E=r(884096),S=r(438396),b=r(715775),I=r(529886),C=r(197992),T=r(2783),N=r(38580),_=r(656927),D=r(921370),x=r(924072),A=r(848717),O=((n=O||{})[n.Fetched=0]="Fetched",n[n.Fetching=1]="Fetching",n[n.NeverFetched=2]="NeverFetched",n);let w=(0,N.eU)(e=>{var t;let r=e(D.OC);return"fullscreen"===r.view?`/api/file/scenegraph_validations/${r.fileKey}`:(0,A.E)(r)&&(null==(t=r.resource)?void 0:t.type)==="server_file"?`/api/admin/scenegraph_validations/${r.resource.key}`:null}),P=(0,N.eU)(e=>null!=e(w)),k=(()=>{let e=(0,N.eU)((0,T.Ok)());return(0,N.eU)(t=>t(e),async(t,r)=>{let n;if(t(e).status===m.r.LOADING)return;let i=t(w);if(i){r(e,(0,T.ux)());try{n=await R(i)}catch(t){r(e,(0,T.uW)(t));return}r(e,(0,T.NY)(n))}})})();async function R(e){let t=await (0,_.GD)(e),r=new x._;for(let e of t.data.meta.data.results.violations)if("always-fail-for-testing"!==e.name)for(let t of e.instances)r.add(t.guid,t.message);return r}var F=r(629019),V=r.n(F),L=r(970501),B=r(77083),G=r(210106),M=r(956722);let U=y.cx.inlineBlock.bRadius4.minW40.w40.h16.flex.alignCenter.justifyCenter.fontSemiBold,$={[M.DB.Grouping]:U.colorBgInverse.colorTextOninverse.$,[M.DB.Shape]:U.colorBgSuccess.colorTextOnsuccess.$,[M.DB.DesignSystems]:U.colorBgComponent.colorTextOncomponent.$,[M.DB.ImmutableFrame]:U.colorBgFigjamTertiary.colorText.$,[M.DB.Media]:U.colorBgWarning.colorTextOnwarning.$,[M.DB.Other]:U.colorBgSecondary.colorBgOnselected.$},K={fontSize:9,lineHeight:"16px",fontStyle:"normal"};function H({type:e}){let t=(0,M.p7)(e);return a.createElement("div",{title:e,className:$[t],style:K},M.vu[e])}let z={CREATED:"ADD",MODIFIED:"EDIT",REMOVED:"DEL"},Y={CREATED:U.minW36.colorBgSuccess.colorTextOnsuccess.$,MODIFIED:U.minW36.colorBgBrandSecondary.colorTextOnbrandSecondary.$,REMOVED:U.minW36.colorBgDanger.colorTextOndanger.$};function j({phase:e}){return a.createElement("div",{title:e,className:Y[e],style:K},z[e])}function W({iconConfig:e}){if("string"!=typeof e)return a.createElement(v.Y,{width:"hug-contents"},a.createElement(j,{phase:e.phase}),"NONE"!==e.type?a.createElement(H,{type:e.type}):a.createElement("div",{className:U.$}));switch(e){case"CREATED":case"MODIFIED":case"REMOVED":return a.createElement(j,{phase:e});default:return a.createElement(H,{type:e})}}function J({label:e}){return a.createElement("div",{title:e,className:U.b1.colorBorder.colorTextSecondary.$,style:K},e)}let q="figmascope_guid_display--canUnderline--8blSe";function X({guid:e}){let t=(0,d.md)(I.AC).getNode(e);return a.createElement(ep,{type:3,targetNode:t,fallbackCopyOnClickText:(0,G.qJ)(e)},ea(e))}function Z({styleId:e}){let t=(0,d.md)(I.AC).getStyle(e);return a.createElement(ep,{type:3,targetNode:t,fallbackCopyOnClickText:B.PK.toString(e)},eo(e,B.PK))}function Q({variableId:e}){let t=(0,d.md)(I.AC).getVariable(e);return a.createElement(ep,{type:3,targetNode:t,fallbackCopyOnClickText:B.sD.toString(e)},eo(e,B.sD))}function ee({variableCollectionId:e}){let t=(0,d.md)(I.AC).getVariableCollection(e);return a.createElement(ep,{type:3,targetNode:t,fallbackCopyOnClickText:B.gr.toString(e)},eo(e,B.gr))}function et({overrideKey:e}){let t=(0,G.dL)(e);return a.createElement(eh,{type:t?2:0},ea(e))}function er({overridePath:e}){let{isValid:t,formatted:r}=es(e);return a.createElement(eh,{type:t?2:0},r)}function en({overridePath:e,targetGuid:t}){let{isValid:r,formatted:n}=es(e),i=(0,d.md)(I.AC).getNode(t);return a.createElement(ep,{type:r?3:0,targetNode:i,fallbackCopyOnClickText:(0,G.bb)(e)},n)}function ei({guid:e}){let t=(0,G.dL)(e);return a.createElement(eh,{type:t?1:0},ea(e))}function el({guidPath:e}){let{isValid:t,formatted:r}=es(e);return a.createElement(eh,{type:t?1:0},r)}function ea(e){return`(${(0,G.qJ)(e)})`}function es(e){let t=(0,G.ZJ)(e);return{isValid:e.length>0&&t.every(G.dL),formatted:`[${t.map(e=>`(${(0,G.qJ)(e)})`).join(", ")}]`}}function eo(e,t){let r=t.toGuidStrIfLocal(e);if(r)return ea(r);let n=t.toRefIfSubscribed(e);return n?`${n.key.slice(0,5)}...${n.key.slice(-5)}/${n.version}`:"[unknown_asset_id]"}var eu=((i=eu||{})[i.Invalid=0]="Invalid",i[i.Normal=1]="Normal",i[i.Override=2]="Override",i[i.Link=3]="Link",i);let ec=y.cx.inlineBlock,ed={0:ec.colorTextDanger.$,1:ec.colorText.fontSemiBold.$,2:ec.colorTextSecondary.italic.$,3:ec.colorTextFigjam.fontSemiBold.$};function eh({type:e,children:t}){return a.createElement("span",{className:ed[e]},t)}function ep({type:e,targetNode:t,fallbackCopyOnClickText:r,children:n}){let i=(0,h.Xr)(C.AJ),l=t?()=>i(t.guidStr()):()=>{(0,L.Dk)(r).then(()=>window.alert(`Copied ${r} to clipboard`)).catch(()=>window.alert(r))},s=t?e:0;return a.createElement("span",{role:"button",className:V()(y.cx.inlineBlock.$,"figmascope_guid_display--guidLink--UKqmp"),onClick:l},a.createElement(v.Y,{spacing:4},t&&a.createElement(W,{iconConfig:t.iconConfig()}),a.createElement("span",{className:V()(ed[s],q)},n),t&&a.createElement("span",{className:V()(ed[s],q,y.cx.fontNormal.$)},t.name())))}var em=r(457473),ef=r(806247),ey=r(290357),eg=r(461816),ev=r.n(eg),eE=r(921436),eS=r(202980),eb=r(989368),eI=r(664080),eC=r(923454);function eT(e,t,r){let n={...e},i=!1;for(let e of t)i=i||n[e]!==r,n[e]=r;return i?n:e}function eN(e,t){let r={...e},n=!1;for(let e of t)n=n||e in r,delete r[e];return n?r:e}var e_=((l=e_||{})[l.No=0]="No",l[l.Yes=1]="Yes",l);function eD(e,t,r,n=1){let i=[t,...r];return e[t]?n?eN(e,i):eT(e,i,!1):eT(e,i,!0)}function ex(e=1){let t=(0,N.eU)({});return(0,N.eU)(e=>e(t),(r,n,i,l)=>n(t,eD(r(t),i,l??[],e)))}let eA=(e,t)=>{var r;return(null==(r=e.getNode(t))?void 0:r.mapAncestors(e=>e.guidStr()))??[]},eO=(e,t)=>{var r;return(null==(r=e.getNode(t))?void 0:r.mapDescendants(e=>e.guidStr()))??[]},ew=(0,d.FZ)((0,N.eU)({}),(e,t,r)=>{let n=r(I.AC);switch(t.type){case"toggleNodeExpanded":return eD(e,t.guidStr,t.toggleSubtree?eO(n,t.guidStr):[]);case"expandNodeAncestors":return eT(e,eA(n,t.guidStr),!0);case"expandNodeDescendants":return eT(e,[t.guidStr,...eO(n,t.guidStr)],!0);case"collapseNodeDescendants":return eN(e,[t.guidStr,...eO(n,t.guidStr)])}});var eP=r(385477);let ek=(0,N.eU)(e=>e(eP.l).sortOrder,(e,t,r)=>t(eP.l,e=>({...e,sortOrder:r}))),eR=(0,N.eU)(e=>{var t;let r=[eP.h.Position,eP.h.Name,eP.h.NodeId];return(null==(t=e(I.zm)[0])?void 0:t.treeMemoryUsage)!=null&&r.push(eP.h.Memory),r.sort(),r}),eF=(0,N.eU)(e=>{switch(e(ek)){case eP.h.Position:return eV;case eP.h.Name:return eL;case eP.h.Memory:return eB;case eP.h.NodeId:return eG}});function eV(e,t){var r,n;let i=null==(r=e.nodeChange.parentIndex)?void 0:r.position,l=null==(n=t.nodeChange.parentIndex)?void 0:n.position;return null==i&&null==l?0:null==l?1:null==i||i<l?-1:i>l?1:eG(e,t)}function eL(e,t){return e.displayName().localeCompare(t.displayName())||eG(e,t)}function eB(e,t){return(t.treeMemoryUsage??0)-(e.treeMemoryUsage??0)||eG(e,t)}function eG(e,t){let{sessionID:r,localID:n}=e.guid(),{sessionID:i,localID:l}=t.guid();return r-i||n-l}var eM=r(574078),eU=r(480201),e$=r(402791);let eK=eU.W.Dropdown,eH=eU.W.Option,ez=eU.W.Separator;function eY({contextMenuData:{guidStr:e,position:t},onClose:r}){let n=a.useContext(C.f),i=a.useRef(null);(0,eM.w)(i,r);let l=(0,d.md)(I.AC).getNode(e),[s,o]=(0,d.fp)(b.Oz),u=(0,h.Xr)(ew);if(null==l)return null;let c=e=>()=>{e(),r()},p=l.children().length>0,m=(()=>{if(n){let e=(0,C.hh)(l);if(e)return c(()=>n(e))}})(),f=l.isInternalOnly()||"DOCUMENT"===l.nodeType()||"CANVAS"===l.nodeType(),y=e=>c(()=>eI.glU.triggerAction(e,{guid:l.guidStr()})),v=(null==s?void 0:s.node.guidStr())===l.guidStr();return a.createElement(eK,{style:{...g.sx.fixed.$,...t}},a.createElement("div",{ref:i},m&&a.createElement(eH,{onClick:m},"Jump to node"),p&&a.createElement(eH,{onClick:c(()=>u({type:"expandNodeDescendants",guidStr:e}))},"Expand descendants"),p&&a.createElement(eH,{onClick:c(()=>u({type:"collapseNodeDescendants",guidStr:e}))},"Collapse descendants"),(m||p)&&a.createElement(ez,null),v&&a.createElement(eH,{onClick:c(()=>o({type:"clear"}))},"Stop diffing against this node"),(!v||s.type!==b.ok.Layer)&&a.createElement(eH,{onClick:c(()=>o({type:"start",diffType:b.ok.Layer,guidStr:e}))},"Layer diff against this node"),(!v||s.type!==b.ok.Tree)&&a.createElement(eH,{onClick:c(()=>o({type:"start",diffType:b.ok.Tree,guidStr:e}))},"Tree diff against this node"),!f&&a.createElement(ez,null),!f&&m&&"DOCUMENT"!==l.nodeType()&&"CANVAS"!==l.nodeType()&&a.createElement(eH,{onClick:y("debug-print-as-test-code")},a.createElement(e$.Tx,{id:"fullscreen_actions.debug-print-as-test-code"})),!f&&m&&"VECTOR"===l.nodeType()&&a.createElement(eH,{onClick:y("debug-print-vector-network-as-test-code")},a.createElement(e$.Tx,{id:"fullscreen_actions.debug-print-vector-network-as-test-code"}))))}var ej=r(216817),eW=r(738957),eJ=r(606469);let eq=a.createContext(()=>!1);function eX({children:e,className:t,style:r}){let n=a.useRef(null),i=a.useCallback(()=>{var e;return!!(null==(e=n.current)?void 0:e.contains(document.activeElement))},[]);return a.createElement(eW.dP,{ref:n,className:t,style:r,allowVim:!0},a.createElement(eq.Provider,{value:i},e))}let eZ="figmascope_tree_item--expansionToggle--cDA3p";function eQ({children:e,diffType:t,isExpanded:r,isLeaf:n,isPinned:i,isSelected:l,isChanging:s,indent:o,style:u,keyboardNavigationPath:c,toggleExpanded:d,togglePinned:h,select:p,onContextMenu:m,onMouseEnter:f,onMouseLeave:y,isEditing:g,setIsEditing:v}){let{setKeyboardNavigationElement:E,keyboardNavigationItem:S,isFocused:b}=(0,eW.M3)({path:c}),I=a.useContext(eq),C=(0,ej.Z)(l);a.useEffect(()=>{!C&&l&&!b&&I()&&(null==S||S.focus())},[b,C,l,S,I]);let T=a.useRef(!1),N=a.useCallback(e=>e.target instanceof Element&&"BUTTON"===e.target.tagName,[]),_=a.useCallback(e=>{var t;return!!(e.target instanceof Element&&(e.target.classList.contains(eZ)||(null==(t=e.target.parentElement)?void 0:t.classList.contains(eZ))))},[]);return a.createElement("button",{ref:E,style:u,className:V()("figmascope_tree_item--treeItem--zf8eH",{"figmascope_tree_item--selected--eG-Br":l||b,"figmascope_tree_item--changing--5zuTD":s,"figmascope_tree_item--disableHover--y2Gw5":g}),onFocus:p,onMouseDown:g?void 0:e=>{(N(e)||_(e))&&e.detail>1&&e.preventDefault(),_(e)?T.current=e.detail>1:T.current=!0},onClick:g?void 0:e=>{T.current?T.current=!1:d(e.metaKey||e.altKey),e.currentTarget.focus()},onMouseEnter:f,onMouseLeave:y,onDoubleClick:e=>{_(e)||(v?v(!0):d(e.metaKey))},onKeyDown:e=>{(r&&(0,eW.yn)(e.code,!0)||!r&&(0,eW.lv)(e.code,!0))&&d(e.metaKey)},onContextMenu:m},a.createElement(eJ.Y,null,a.createElement(e0,{indent:o,isLeaf:n,isExpanded:r}),e,h&&!g&&a.createElement(e2,{isPinned:!!i,togglePinned:h}),t&&a.createElement(e1,{diffType:t}),!1===g&&v&&a.createElement(e8,{onClick:()=>{v(!0)}})))}function e0({indent:e,isLeaf:t,isExpanded:r}){return a.createElement("div",{className:V()(eZ,!t&&"figmascope_tree_item--clickable--y04JT"),style:{paddingLeft:14*e,width:14,minHeight:14}},a.createElement("span",null,t?"":r?"\u25BC":"\u25B6"))}function e1({diffType:e}){return a.createElement("div",{title:e,className:y.cx.minW16.h16.bRadius2.ml8.font12.fontBold.lh16.alignCenter.cursorDefault.match(e,{[b.tE.Changed]:y.cx.colorBgBrandSecondary.colorTextOnbrandSecondary,[b.tE.ChildChanged]:y.cx.colorBgBrand.colorTextOnbrand,[b.tE.Added]:y.cx.colorBgSuccess.colorTextOnsuccess,[b.tE.Removed]:y.cx.colorBgDanger.colorTextOndanger}).$},e===b.tE.Added&&"+",e===b.tE.Removed&&"-",(e===b.tE.Changed||e===b.tE.ChildChanged)&&"\u2732")}function e2({isPinned:e,togglePinned:t}){return a.createElement("span",{onClick:t,className:e?"figmascope_tree_item--unpinToggle--X5czi figmascope_tree_item--_pinToggleBase--aafwk":"figmascope_tree_item--pinToggle--XSk0J figmascope_tree_item--_pinToggleBase--aafwk"},e?"Unpin":"Pin")}function e8({onClick:e}){return a.createElement("span",{onClick:e,className:"figmascope_tree_item--editButton--Gt2bw figmascope_tree_item--_pinToggleBase--aafwk"},"Edit")}let e6=a.memo(function({diffType:e,guidStr:t,iconConfig:r,indent:n,index:i,isExpanded:l,isLeaf:s,isOrphan:o,isSelected:u,isStack:c,memoryPercent:d,name:h,overrideKeyStr:p,pageSyncingStatus:m,style:f,validationInfo:g,select:E,toggle:S,showContextMenu:b}){let I=a.useCallback(e=>{e.preventDefault(),b({guidStr:t,position:{left:e.clientX,top:e.clientY}})},[t,b]);return a.createElement(eQ,{diffType:e,keyboardNavigationPath:[i],isSelected:u,isLeaf:s,isExpanded:l,indent:n,style:f,select:()=>E(t),toggleExpanded:e=>S(t,e),onContextMenu:I,onMouseEnter:()=>{eI.Ez5&&eI.Ez5.editorState().figmaScopeHighlightedNode.set(t)},onMouseLeave:()=>{eI.Ez5&&eI.Ez5.editorState().figmaScopeHighlightedNode.set("")}},a.createElement(W,{iconConfig:r}),a.createElement(ei,{guid:t}),o&&a.createElement("span",{className:y.cx.ml4.colorTextWarning.$},"(Orphan)"),p&&a.createElement(et,{overrideKey:p}),a.createElement("div",{title:h,className:y.cx.ellipsis.noWrap.overflowHidden.$},h),a.createElement(v.M,null),c&&a.createElement(J,{label:"STACK"}),a.createElement(e3,{info:g}),null!=m&&a.createElement(e4,{status:m}),null!=d&&a.createElement("span",{className:y.cx.colorTextSecondary.$,title:"Node memory usage"},d))});function e3({info:e}){if(void 0===e||0===e.forSelf&&0===e.forChildren)return null;let t=[];e.forSelf&&t.push(`${(0,eb.td)(e.forSelf,"scenegraph validation error")} for this node`),e.forChildren&&t.push(`${(0,eb.td)(e.forChildren,"scenegraph validation error")} in this node's children`);let r=y.cx.flex.alignCenter.justifyCenter.if(0===e.forSelf,y.cx.colorTextWarning,y.cx.colorTextDanger.fontSemiBold).$;return a.createElement("div",{title:t.join(", "),className:r},e.forSelf?(0,eb.td)(e.forSelf,"error"):(0,eb.LD)(e.forChildren,"Child error"))}function e9({style:e,data:{displayedLayers:t,pagesList:r,selectedGuid:n,...i},index:l}){let s=t[l],o=(0,eS.zN)(e),u=null;return s.isCanvas&&r&&(u=(0,eC.Fy)(r,s.guidStr)),a.createElement(e6,{...s,...i,isSelected:n===s.guidStr,style:o,index:l,pageSyncingStatus:u})}function e7({pagesList:e}){let t=(0,d.md)(te),[r,n]=(0,d.fp)(C.AJ),[i,l]=a.useState(null),s=a.useRef(null);a.useEffect(()=>{var e;let n=t.findIndex(e=>e.guidStr===r);n>=0&&(null==(e=s.current)||e.scrollToItem(n,"smart"))},[t,r]);let o=(0,h.Xr)(ew);a.useEffect(()=>{o({type:"expandNodeAncestors",guidStr:r})},[o,r]);let u=a.useCallback((e,t)=>{o({type:"toggleNodeExpanded",guidStr:e,toggleSubtree:t})},[o]);return 0===t.length?a.createElement("div",null,"Empty Scene"):a.createElement(a.Fragment,null,a.createElement(em.A,{disableWidth:!0},({height:i})=>a.createElement(ef.Y1,{itemSize:18,itemCount:t.length,height:i,ref:s,itemData:{displayedLayers:t,selectedGuid:r,pagesList:e,select:n,toggle:u,showContextMenu:l},width:"100%"},e9)),i&&a.createElement(eY,{contextMenuData:i,onClose:()=>{l(null)}}))}function e4({status:e}){let t=y.cx.cursorDefault.font14.lh0.$;switch(e){case eI.xal.NOT_LOADED:return a.createElement("span",{className:t,title:"Page not loaded due to incremental loading"},"\u2601\uFE0F");case eI.xal.REQUESTED:return a.createElement("span",{className:t,title:"Page loading in progress"},"\u26C5");case eI.xal.LOADED:return null}}let e5=(0,N.eU)(e=>{var t;let r=e(I.AC),n=e(k),i=new Map;if(n.status!==m.r.SUCCESS)return i;let l=e=>{let t=i.get(e);if(t)return t;let r={forSelf:0,forChildren:0};return i.set(e,r),r};for(let e of n.value.keys()){l(e).forSelf++;let n=null==(t=r.getNode(e))?void 0:t.parent();for(;n&&!i.has(n.guidStr());)l(n.guidStr()).forChildren++,n=n.parent()}return i}),te=(0,N.eU)(e=>{let t=e(I.AC),r=t.getRootNodes(),n=e(b.sg),i=e(ew),l=e(eF),a=e(e5),s=(()=>{switch(n.type){case b.ok.Tree:return[n.node];case b.ok.File:return n.scene.getRootNodes();default:return[]}})(),o="multiplayer_journal"===t.type,u={sortFn:l,expandedGuids:i,guidToValidationInfo:a,showOverrideKeys:!o,computeChildren:!o};return ev()(r,e=>{if(!e)return[];if(0===s.length)return tt(e,0,u);let t=tn(e,s);return t?tr(e,t,0,u):function e(t,r,n,i){let l=t.guidStr(),a=i.computeChildren?t.children():[],s=0===a.length,o=!!i.expandedGuids[l],u=!1,c=ev()(a,t=>{var l;let a=(()=>{let l=tn(t,r);if(l)return tr(t,l,n+1,i);let a=r.filter(e=>e.ancestorPathStr().includes(t.guidStr()));return a.length>0?e(t,a,n+1,i):tt(t,n+1,i)})();return u=u||(null==(l=a[0])?void 0:l.diffType)!=null,a}),d={diffType:u?b.tE.ChildChanged:void 0,validationInfo:i.guidToValidationInfo.get(l),guidStr:l,iconConfig:t.iconConfig(),indent:n,isExpanded:o,isLeaf:s,isOrphan:t.isOrphan(),name:t.displayName(),overrideKeyStr:i.showOverrideKeys?t.overrideKeyStr():"",memoryPercent:t.memoryPercentStr(),isStack:t.isStack(),isCanvas:t.isCanvas()};return o?[d,...c]:[d]}(e,s,0,u)})});function tt(e,t,r){let n=e.guidStr(),i=r.computeChildren?e.children():[],l=0===i.length,a=!!r.expandedGuids[n],s={diffType:void 0,validationInfo:r.guidToValidationInfo.get(n),guidStr:n,iconConfig:e.iconConfig(),indent:t,isExpanded:a,isLeaf:l,isOrphan:e.isOrphan(),name:e.displayName(),overrideKeyStr:r.showOverrideKeys?e.overrideKeyStr():"",memoryPercent:e.memoryPercentStr(),isStack:e.isStack(),isCanvas:e.isCanvas()};return a?[s,...ev()(ti(i,r.sortFn),e=>tt(e,t+1,r))]:[s]}function tr(e,t,r,n){let i=e??t;if(!i)throw Error("Diffing two nothings");if(e&&t&&e.treeDiffKey()!==t.treeDiffKey())throw Error("Diffing nodes with mismatched keys");let l=i.guidStr(),a=ti((null==e?void 0:e.children())??[],n.sortFn),s=ti((null==t?void 0:t.children())??[],n.sortFn),o=n.computeChildren?(0,eE.TR)(a,s,e=>e.treeDiffKey()):[],u=!1,c=ev()(o,({left:e,right:t})=>{var i;let l=tr(e,t,r+1,n);return u=u||(null==(i=l[0])?void 0:i.diffType)!=null,l}),d=e&&t&&(0,ey.diff)(e.nodeChange,t.nodeChange,(e,t)=>"commandsBlob"===t),h=(0,b.VT)(e,t,!!d,u),p=null==e?void 0:e.name(),m=null==t?void 0:t.name(),f=null!=p&&null!=m&&p!==m?`${p} <=> ${m}`:i.name(),y=!!n.expandedGuids[l],g={diffType:h,validationInfo:n.guidToValidationInfo.get(l),guidStr:l,iconConfig:i.iconConfig(),indent:r,isExpanded:y,isLeaf:0===o.length,isOrphan:!!(null==e?void 0:e.isOrphan()),name:f,overrideKeyStr:n.showOverrideKeys?i.overrideKeyStr():"",memoryPercent:i.memoryPercentStr(),isStack:i.isStack(),isCanvas:i.isCanvas()};return y?[g,...c]:[g]}function tn(e,t){let r=e.treeDiffKey();return t.find(e=>e.treeDiffKey()===r)}function ti(e,t){return e.slice().sort(t)}var tl=r(55330),ta=r(897138),ts=r(695614),to=r(562522),tu=r(291909),tc=r(617618),td=r(244126),th=r(938551),tp=r(499200),tm=r(693917),tf=r(513378),ty=r(860168);let tg=(0,tp.jz)(ty.HJx),tv=(0,tp.jz)(ty.EJM),tE=new WeakMap;function tS(e){let t=tE.get(e);if(void 0!==t)return t;let[r,n]=eI.Vzr.generateThumbnailForNode((0,G.qJ)(e),4*tv,4*tg,4,{forceContentsOnly:!0,isDetatchedComponentScene:!1});if(!n||0===n.length||!r)return tE.set(e,null),null;let{width:i,height:l}=r,a={url:URL.createObjectURL(new Blob([n])),renderWidth:i/4,renderHeight:l/4};return tE.set(e,a),a}let tb=(0,tp.jz)(ty.HJx),tI=(0,tp.jz)(ty.EJM);function tC({thumbnailInput:e}){let t=tS(e),r=(0,tm.c6)((0,G.qJ)(e));return t?a.createElement("div",{className:y.cx.wFull.flex.flexShrink1.itemsCenter.justifyCenter.$,style:r},a.createElement(tf.J,{className:"figmascope_thumbnail_preview_panel--thumbnailPreview--UmQa0",src:t.url,width:t.renderWidth>tI?tI:t.renderWidth,height:t.renderHeight>tb?tb:t.renderHeight})):a.createElement("span",{className:y.cx.noWrap.colorTextDesign.$},"Error generating thumbnail")}function tT({value:e}){switch(e.type){case tu.hy.BlobIndex:return a.createElement(tG,{index:e.value});case tu.hy.SensitiveText:return a.createElement(tP,{value:e.value});case tu.hy.Boolean:return a.createElement(tO,{value:e.value});case tu.hy.Numeric:return a.createElement(tF,{value:e.value});case tu.hy.String:return a.createElement(tw,{value:e.value});case tu.hy.Position:return a.createElement(tk,{value:e.value});case tu.hy.Color:return a.createElement(tR,{value:e.value});case tu.hy.Vector:return a.createElement(tV,{value:e.value});case tu.hy.Matrix:return a.createElement(tL,{value:e.value});case tu.hy.NodeId:return a.createElement(X,{guid:e.value});case tu.hy.StyleId:return a.createElement(Z,{styleId:e.value});case tu.hy.VariableId:return a.createElement(Q,{variableId:e.value});case tu.hy.VariableCollectionId:return a.createElement(ee,{variableCollectionId:e.value});case tu.hy.OverrideKey:return a.createElement(et,{overrideKey:e.value});case tu.hy.OverridePath:return e.targetGuid?a.createElement(en,{overridePath:e.value,targetGuid:e.targetGuid}):a.createElement(er,{overridePath:e.value});case tu.hy.GenericGuid:return a.createElement(ei,{guid:e.value});case tu.hy.GenericGuidPath:return a.createElement(el,{guidPath:e.value});case tu.hy.GenericGuidPathMapping:return a.createElement(a.Fragment,null,a.createElement(ei,{guid:e.from})," \u21D4 ",a.createElement(el,{guidPath:e.to}));case tu.hy.ImageHash:return a.createElement(tM,{value:e.value});case tu.hy.Bytes:return a.createElement(tB,{value:e.value});case tu.hy.Metadata:return a.createElement(tK,{value:e.value});case tu.hy.Error:return a.createElement(tH,{value:e.value});case tu.hy.Image:return a.createElement(tC,{thumbnailInput:e.value});case tu.hy.EditScope:return a.createElement(t$,{value:e.value});default:(0,o.xb)(e)}}let tN=y.cx.noWrap,t_=tN.colorTextDesign,tD=tN.colorTextSuccess,tx=tN.colorTextDanger,tA=tN.colorTextSecondary;function tO({value:e}){return a.createElement("span",{className:tD.$},e?"TRUE":"FALSE")}function tw({value:e}){return a.createElement("span",{className:t_.$},'"',e,'"')}function tP({value:e}){let t=(0,d.md)(I.AC).sensitiveTextPolicy;return a.createElement("span",{className:t_.$},'"',(0,th.b)(e,t),'"')}function tk({value:e}){return a.createElement(v.Y,{width:"hug-contents"},a.createElement("span",{className:t_.$},(0,tc.PZ)(e)),a.createElement("span",{className:tA.$},"(compressed: `",e,"`)"))}function tR({value:e}){let t=td.F.format(e);return a.createElement(v.Y,{width:"hug-contents"},a.createElement("span",{className:y.cx.inlineBlock.w12.h12.bRadius2.$,style:{backgroundColor:t}}),a.createElement("span",{className:t_.$},t))}function tF({value:e}){return a.createElement("span",{className:tD.$},(0,tu.ZV)(e))}function tV({value:e}){return a.createElement("span",{className:tD.$},`<${(0,tu.ZV)(e.x)}, ${(0,tu.ZV)(e.y)}>`)}function tL({value:e}){let{m00:t,m01:r,m02:n,m10:i,m11:l,m12:s}=e;return a.createElement("div",{className:tD.$},"[",[[t,r,n],[i,l,s]].map(e=>`[${e.map(tu.ZV).join(", ")}]`).join(", "),"]")}function tB({value:e}){return a.createElement("span",{className:tD.$},tz(e))}function tG({index:e}){let t=(0,d.md)(I.AC).getBlobByIndex(e);return t?a.createElement("span",{className:tD.$},"Blob ",e," ::"," ","string"==typeof t?t:tz(t.bytes)):a.createElement(tH,{value:`Blob ${e} :: [MISSING]`})}function tM({value:e}){let t=tY(e,"");return a.createElement(a.Fragment,null,a.createElement("span",{className:tD.$},t),a.createElement("span",null,a.createElement(tU,{hash:t,name:"staging"})," | ",a.createElement(tU,{hash:t,name:"prod"})))}function tU({hash:e,name:t}){return a.createElement("a",{href:`https://${"staging"===t?"staging-":""}admin.figma.com/admin/image/${e}`},t)}function t$({value:e}){return a.createElement(v.Y,{width:"hug-contents"},a.createElement("span",{className:tD.$},e.type),a.createElement("span",{className:t_.$},e.label))}function tK({value:e}){return a.createElement("span",{className:tA.$},"(",e,")")}function tH({value:e}){return a.createElement("span",{className:tx.$},e)}function tz(e){return`binary[${e.length}] = ${tY(e," ")}`}function tY(e,t){let r="";for(let n=0;n<e.length;++n){if(n>=30){r+="...";break}r+=function(e){let t=e.toString(16);return 1===t.length?"0"+t:t}(e[n])+t}return r}function tj({searchRef:e}){let t=(0,d.md)(I.AC),[r,n]=(0,d.fp)(C.AJ),i=(0,d.md)(C.Sd),l=a.useMemo(()=>i.map(e=>t.getNode(e)).filter(ts.Vq).map(e=>({node:e,matches:[{property:"guid",value:e.guid(),isExact:!0},{property:"name",value:e.name(),isExact:!0}]})).reverse(),[t,i]),{searchState:s,requestSearch:o,clearSearchResults:u,showRecentSelections:c,indexingCount:h}=function(e,t,r){let[n,i]=a.useState({status:"initial"}),l=a.useRef(0),[s,o]=a.useState(0),u=a.useMemo(()=>(0,ta.s)((t,r)=>{let n=++l.current,a=new TaskController({priority:"user-visible"});scheduler.postTask(()=>i({status:"indexing"}),{signal:a.signal,delay:300}).catch(()=>{}),e.search(t,r,o).then(e=>{a.abort(),n===l.current&&i({status:"success",results:e})}).catch(e=>{a.abort(),n===l.current&&i({status:"failure",error:e})})}),[e]),c=a.useCallback(()=>i({status:"initial"}),[]),d=a.useCallback(()=>i({status:"recent",results:r}),[r]);return{searchState:n,requestSearch:a.useCallback(e=>{c(),u(e,t)},[c,u,t]),showRecentSelections:d,clearSearchResults:c,indexingCount:s}}(t,r,l),p=a.useRef(null);(0,eM.w)(p,u);let m=a.useCallback(e=>{u(),n(e.node.guid())},[u,n]);return a.createElement(eW.dP,{className:y.cx.flex1.$,ref:p,allowVim:!0},a.createElement(tW,{searchRef:e,requestSearch:o,showRecentSelections:c}),"initial"!==s.status&&a.createElement(tJ,{searchState:s,selectResult:m,indexingCount:h,sensitiveTextPolicy:t.sensitiveTextPolicy}))}function tW({searchRef:e,requestSearch:t,showRecentSelections:r}){let{setKeyboardNavigationElement:n}=(0,eW.M3)({path:[0,0],id:"input"}),i=e=>{let n=e.target.value;n?t(n):r()};return a.createElement("input",{ref:t=>{n(t),e.current=t},type:"text",placeholder:"Search (hover the ? for details)",className:"figmascope_layer_search_bar--searchBar--xYknN",onFocus:i,onChange:i})}function tJ({searchState:e,selectResult:t,indexingCount:r,sensitiveTextPolicy:n}){return a.createElement("div",{className:y.cx.absolute.zIndexModal.colorBg.b1.colorBorder.mt2.overflowAuto.$,style:{maxHeight:450,minWidth:500,boxShadow:"0px 2px 14px var(--color-shadow, rgba(0, 0, 0, 0.15))"}},"indexing"===e.status&&a.createElement(tq,{text:`Indexing search results (this may take a moment)... ${r?`[${r}/???]`:""}`}),"failure"===e.status&&a.createElement(tq,{text:`Error: ${e.error}.`}),"recent"===e.status&&e.results.map((e,r)=>a.createElement(tX,{key:r,result:e,index:r,onClick:()=>t(e)})),"success"===e.status&&(0===e.results.length?a.createElement(tq,{text:["No results.","With view-only permissions, nodes are not loaded until their page is opened.","show"===n?"":"Searching by name or text is disabled because text is being redacted."]}):e.results.map((e,r)=>a.createElement(tX,{key:r,result:e,index:r,onClick:()=>t(e)}))))}function tq({text:e}){return a.createElement(a.Fragment,null,(Array.isArray(e)?e:[e]).map((e,t)=>a.createElement("div",{key:t,className:y.cx.colorBg.colorTextSecondary.px8.py4.$},e)))}function tX({result:e,index:t,onClick:r}){let{node:n,matches:i}=e,{setKeyboardNavigationElement:l,keyboardNavigationItem:s,isFauxFocused:o}=(0,eW.M3)({path:[1,t],id:n.guidStr()});return a.useEffect(()=>{s&&0===t&&s.fauxFocus()},[s,t]),a.createElement("button",{ref:l,className:V()(y.cx.block.wFull.px4.py8.colorText.flex.itemsCenter.alignLeft.$,"figmascope_layer_search_bar--searchResult--tW-6s",o&&"figmascope_layer_search_bar--fauxFocus--pmMRc"),onClick:r},a.createElement(v.Y,{spacing:4},a.createElement(W,{iconConfig:e.node.iconConfig()}),a.createElement(ei,{guid:e.node.guid()}),a.createElement(to.R,{className:y.cx.overflowHidden.$,text:n.nameWithPage()}),a.createElement(v.M,null),i.filter(({property:e})=>!["guid","name","type"].includes(e)).map(({property:e,value:t},r)=>{let n=(0,tu.wC)(e,t);return a.createElement(v.Y,{key:r,spacing:4,width:"hug-contents"},a.createElement("div",null,e,":"),n&&a.createElement(tT,{value:n}))})))}var tZ=r(487644);function tQ({children:e}){return a.createElement("div",{className:y.cx.colorBorder.px8.py4.bb1.bSolid.$},a.createElement(v.Y,null,e))}function t0(e){let t={className:"figmascope_toolbar_components--iconButton--cvjWZ",children:a.createElement(tZ.B,{svg:e.svg}),title:e.label,"aria-label":e.label};return"href"in e?a.createElement("a",{...t,href:e.href,target:"blank"}):a.createElement("button",{...t,onClick:e.onClick,disabled:e.disabled})}var t1=r(444890),t2=r(816679),t8=r(167198),t6=r(247866);function t3({searchRef:e}){let t=(0,d.md)(P),[r,n]=(0,d.fp)(C.jI),[i,l]=(0,d.fp)(C.JN),o=!!a.useContext(C.f),[u,c]=(0,d.fp)(C.bA),[h,p]=(0,d.fp)(ek),m=(0,d.md)(eR);return a.createElement(tQ,null,a.createElement(tj,{searchRef:e}),a.createElement("select",{name:"sort",title:"Sets the layers panel sort order",onChange:e=>{let t=e.target.value;s.az.trackDefinedEvent("figmascope.sort_order_change",{order:function(e){switch(e){case eP.h.Position:return"position";case eP.h.Name:return"name";case eP.h.Memory:return"memory";case eP.h.NodeId:return"node_id"}}(t)}),p(t)},defaultValue:h},m.map(e=>a.createElement("option",{key:e,value:e},e))),a.createElement(t0,{label:"Select Previous",onClick:()=>{n(),s.az.trackDefinedEvent("figmascope.select_prev_next",{direction:"prev",source:"button"})},disabled:!r,svg:t1.A}),a.createElement(t0,{label:"Select Next",onClick:()=>{l(),s.az.trackDefinedEvent("figmascope.select_prev_next",{direction:"next",source:"button"})},disabled:!i,svg:t2.A}),a.createElement(tl.S,{label:"Follow selection",disabled:!o,checked:!!o&&u,onChange:e=>{o&&c(e.currentTarget.checked)}}),t&&a.createElement(t9,null))}function t9(){let[e,t]=(0,d.fp)(k),r=e.status===m.r.LOADING;return a.useEffect(()=>{t()},[t]),a.createElement(t0,{label:r?"Fetching scene graph validation failures":"Refetch scenegraph validation failures",onClick:t,svg:r?t8.A:t6.A})}var t7=r(131127),t4=r(841563),t5=r.n(t4),re=r(509952),rt=r(159849),rr=r(838320),rn=r(579038),ri=r(864362);let rl=(0,tp.jz)(ty.hVg),ra=(0,tp.jz)(ty.k$X),rs=ex(e_.No),ro=ex(),ru=a.memo(function({panel:e,items:t,diffItems:r}){let[n,i]=(0,d.fp)(rs),[l,s]=(0,d.fp)(ro),o=a.useMemo(()=>{let e=[],i=ry(t,void 0,l),a=null!=r,s=ry(r??[],void 0,l);for(let t of(0,eE.TR)(i,s,e=>rm(e,void 0)))e=a?e.concat(rE(t.left,t.right,0,void 0,n,l)):e.concat(rv(t.left??t.right,0,void 0,n,l));return e},[t,r,n,l]),u=a.createRef();function c(e){if(void 0!==o[e]){let t=o[e].value;if(t&&t.type===tu.hy.Image){let e=tS(t.value);if(e)return e.renderHeight+ra}}return rl}return a.useEffect(()=>{var e;null==(e=u.current)||e.resetAfterIndex(0)},[u,o]),a.createElement(em.A,{disableWidth:!0},({height:t})=>a.createElement(ef._m,{ref:u,itemSize:c,itemCount:o.length,height:t,itemKey:e=>o[e].expansionKey,itemData:{panel:e,displayedProperties:o,togglePropertyExpanded:i,togglePropertyPinned:s},width:"100%"},rc))});function rc({style:e,index:t,data:{panel:r,displayedProperties:n,togglePropertyExpanded:i,togglePropertyPinned:l}}){let s=n[t],o=(0,ej.Z)(s),[u,c]=a.useState(!1),d=a.useRef(void 0);a.useEffect(()=>(o&&!(0,re.c2)(s.value,o.value)&&(clearTimeout(d.current),c(!0),d.current=setTimeout(()=>{c(!1)},250)),rt.lQ),[s,o]),a.useEffect(()=>()=>clearTimeout(d.current),[]);let h=(0,eS.zN)(e);return a.createElement(rh,{...s,style:h,isChanging:u,panel:r,index:t,togglePropertyExpanded:i,togglePropertyPinned:l})}let rd=a.memo(function({diffValue:e,value:t}){return a.createElement(a.Fragment,null,null!=e&&a.createElement(tT,{value:e}),null!=e&&a.createElement("span",null,"\u21E8"),null!=t&&a.createElement(tT,{value:t}))}),rh=a.memo(function({childExpansionKeys:e,expansionKey:t,indent:r,isExpanded:n,isChanging:i,isPinned:l,isLeaf:o,isImage:u,label:c,index:d,style:h,value:p,diffValue:m,diffType:f,panel:g,togglePropertyExpanded:E,togglePropertyPinned:S,onEdit:b}){let[I,C]=a.useState(!1),T=p&&b?I:void 0,N=I&&p&&b;return a.createElement(eQ,{keyboardNavigationPath:[d],isLeaf:o,isExpanded:n,isChanging:i,indent:u?0:r,style:u?{...h,height:"fit-content",width:"100%",alignItems:"flex-start"}:h,toggleExpanded:r=>{C(!1),n||s.az.trackDefinedEvent("figmascope.expand_row",{field:c,panel:g}),E(t,r?e:[])},isPinned:l,togglePinned:u?void 0:()=>{l||s.az.trackDefinedEvent("figmascope.pin_row",{field:c,panel:g}),S(t)},diffType:f,setIsEditing:e=>{p&&b&&(C(e),s.az.trackDefinedEvent("figmascope.edit_property",{field:c}))},isEditing:T},u?a.createElement(rd,{diffValue:m,value:p}):a.createElement(a.Fragment,null,a.createElement("span",{className:y.cx.colorText.$},c),a.createElement("div",{className:y.cx.ellipsis.noWrap.overflowHidden.alignCenter.$},N?a.createElement(rp,{onEdit:b,onFinish:()=>{C(!1)},valueForEditing:p}):a.createElement(rd,{diffValue:m,value:p}))),a.createElement(v.M,null))});function rp({onFinish:e,onEdit:t,valueForEditing:r}){let[n,i]=a.useState(!1),l=(0,tu.M2)(r),[s,o]=a.useState(l||""),u=()=>{if(t&&r){let n=(0,tu.iE)(s,r.type);if(!n){i(!0);return}try{t(n)}catch(e){i(!0);return}e()}};return a.createElement(a.Fragment,null,a.createElement(rr.L,{name:"figmaScopeTreeItem",value:s,type:"string",className:V()("figmascope_properties_panel--editingInput--yqWcf",{"figmascope_properties_panel--editingInputError--rY95m":n}),required:!0,onChange:e=>{i(!1),o(e.target.value)},onKeyDown:t=>{13===t.keyCode?u():27===t.keyCode&&e()},autoFocus:!0}),a.createElement("button",{className:"figmascope_properties_panel--editingInputButtonCancel--cJrnv figmascope_properties_panel--_editingInputButtonBase--CKA0R",onClick:e},"Cancel"),a.createElement("button",{className:"figmascope_properties_panel--editingInputButtonDone--M4EHU figmascope_properties_panel--_editingInputButtonBase--CKA0R",onClick:()=>{u()}},"Done"),a.createElement("div",{className:"figmascope_properties_panel--editingWarningIcon--lTGoK","data-tooltip-type":rn.Ib.TEXT,"data-tooltip":"Editing this field will use the plugin API under-the-hood. This may behave differently\n compared to modifying this field using the UI or Selection Properties.","data-tooltip-offset-y":12},a.createElement(tZ.B,{svg:ri.A,height:"12px",width:"12px",autosize:!0})))}let rm=(e,t)=>{let r=e.key??e.label;return t?[t,r].join("."):r},rf=(e,t)=>!!t[e],ry=(e,t,r)=>[...e.filter(e=>rf(rm(e,t),r)),...e.filter(e=>!rf(rm(e,t),r))],rg=(e,t,r,n)=>{if(e)return!1;let i=n[t];return null!=i?i:r},rv=(e,t,r,n,i)=>{var l;let a=rm(e,r),s=0===e.children.length,o=(null==(l=e.value)?void 0:l.type)===tu.hy.Image,u=rg(s,a,e.expandByDefault,n),c=ev()(ry(e.children??[],a,i),e=>rv(e,t+1,a,n,i)),d={label:e.label,value:e.value,isExpanded:u,isLeaf:s,isImage:o,indent:t,expansionKey:a,childExpansionKeys:ev()(c,e=>[e.expansionKey,...e.childExpansionKeys]),isPinned:rf(a,i),onEdit:e.onEdit};return u?[d,...c]:[d]},rE=(e,t,r,n,i,l)=>{var a;let s=e??t;if(!s)throw Error("Nothing to diff");if(e&&t&&rm(e,n)!==rm(t,n))throw Error("Mismatched keys");let o=rm(s,n),u=ry((null==e?void 0:e.children)??[],o,l),c=ry((null==t?void 0:t.children)??[],o,l),d=(0,eE.TR)(u,c,e=>rm(e,o)),h=!1,p=ev()(d,({left:e,right:t})=>{let n=rE(e,t,r+1,o,i,l);return h=h||null!=n[0].diffType,n}),m=0===d.length,f=!t5()(null==e?void 0:e.value,null==t?void 0:t.value),y=(0,b.VT)(e,t,f,h),g=rg(m,o,s.expandByDefault,i),v=(null==(a=s.value)?void 0:a.type)===tu.hy.Image,E={label:s.label,value:s.value,diffValue:e&&t&&f?null==t?void 0:t.value:void 0,isExpanded:g,isLeaf:m,isImage:v,indent:r,expansionKey:o,childExpansionKeys:ev()(p,e=>[e.expansionKey,...e.childExpansionKeys]),isPinned:rf(o,l),diffType:y};return g?[E,...p]:[E]};var rS=r(524403),rb=r(91365),rI=r(630834);function rC({selectedNode:e,diffNode:t,onClose:r}){return a.createElement(tQ,null,e?a.createElement(rT,{selectedNode:e,diffNode:t}):a.createElement(v.M,null),a.createElement(t0,{label:"Help",href:rS.e,svg:rb.A}),r&&a.createElement(t0,{label:"Close FigmaScope",onClick:r,svg:rI.default}))}function rT({selectedNode:e,diffNode:t}){let[r,n]=(0,d.fp)(b.Oz),i=(0,h.Xr)(C.AJ);return a.createElement("div",{className:y.cx.flex1.ml10.my4.$},a.createElement("div",null,t&&a.createElement("span",{className:y.cx.colorTextSecondary.$},"Diffing "),a.createElement("span",{className:y.cx.fontSemiBold.$},e.nameWithPage()),t&&a.createElement("span",{className:y.cx.colorTextSecondary.$}," against "),t&&a.createElement("span",{className:y.cx.fontSemiBold.$},t.nameWithPage())),r&&a.createElement("div",{className:y.cx.colorTextSecondary.mt8.$},a.createElement(v.Y,{spacing:8,width:"hug-contents",height:"hug-contents",verticalAlignItems:"start"},a.createElement("span",null,"Snapshot of"," ",a.createElement(f.CY,{onClick:()=>i(r.node.guidStr()),className:y.cx.colorTextFigjam.fontSemiBold.$,trusted:!0},r.node.name()),r.type===b.ok.Tree&&" and full subtree"," was taken at"," ",r.time.toLocaleTimeString("en-US")),a.createElement(f.CY,{onClick:()=>n({type:"refresh"}),className:y.cx.colorTextDesign.$,trusted:!0},"Refresh"),a.createElement(f.CY,{onClick:()=>n({type:"clear"}),className:y.cx.colorTextDanger.$,trusted:!0},"Finish"))))}function rN(){let e=(0,d.md)(I.o3),[t,r]=(0,d.fp)(I.XM),n=a.useRef(null);if(e.status!==m.r.SUCCESS)return a.createElement("div",null,"Loading...");function i(t){return e.status!==m.r.SUCCESS?0:16*Object.keys(e.value.scenes[t].getResourceMetadataDisplayInfo()).length+16+8}return a.createElement(a.Fragment,null,a.createElement(em.A,{disableWidth:!0},({height:l})=>a.createElement(ef._m,{itemSize:i,itemCount:e.value.scenes.length,height:l,ref:n,itemData:{scenes:e.value.scenes,activeSceneIndex:t,setActiveSceneIndex:r},width:"100%"},r_)))}function r_({style:e,data:{scenes:t,activeSceneIndex:r,setActiveSceneIndex:n},index:i}){let l=t[i],s=(0,eS.zN)(e);return a.createElement(rD,{style:s,scene:l,selected:i===r,setSelected:()=>{n(i)}})}function rD(e){let{style:t,scene:r,selected:n,setSelected:i}=e,l=r.getResourceMetadataDisplayInfo();return a.createElement("button",{style:t,onClick:i,className:V()("figmascope_scene_switcher--item--Ufk-a",n&&"figmascope_scene_switcher--selected--DWHuZ")},a.createElement(v.Y,{direction:"vertical",width:"fill-parent",padding:8,spacing:4},Object.entries(l).map(([e,t])=>a.createElement("span",{key:e},a.createElement(E.E,{color:"secondary"},e,": "),a.createElement(E.E,{color:"secondary",fontFamily:"monospace",fontWeight:"bold"},t)))))}let rx="figmascope_main_view--left--CUYrg",rA=a.memo(function({embedded:e=!1,emptyStateContent:t,onClose:r,appSelection:n,setAppSelection:i,pagesList:l}){let s=(0,d.md)(I.o3);switch(s.status){case m.r.INIT:return t??a.createElement(t7.zG,null);case m.r.LOADING:return a.createElement(t7.zG,null);case m.r.FAILURE:return a.createElement(t7.rf,{error:s.error});case m.r.SUCCESS:{let t=a.createElement(rw,{embedded:e,appSelection:n,setAppSelection:i,onClose:r,pagesList:l});return e?t:a.createElement(rO,null,t)}}});function rO({children:e}){let t=(0,d.md)(I.BJ);return a.createElement("div",{className:y.cx.hFull.$},a.createElement(v.Y,{direction:"horizontal",width:"fill-parent",height:32,padding:8,spacing:32,backgroundColor:"toolbar"},a.createElement(E.E,{fontWeight:"bold",color:"toolbar"},t.type),Object.entries(t.properties).map(([e,t])=>a.createElement("span",{key:e},a.createElement(E.E,{color:"toolbar-secondary"},e,": "),a.createElement(E.E,{color:"toolbar",fontFamily:"monospace",fontWeight:"bold"},t))),"File"===t.type&&a.createElement(f.vx,{href:`/admin/figmascope/multiplayer_journals/${t.properties["File Key"]}`,target:"_blank"},"View multiplayer journals")),e)}function rw({embedded:e,onClose:t,appSelection:r,setAppSelection:n,pagesList:i}){(0,C.vj)({appSelection:r,setAppSelection:n});let l=(0,d.md)(I._V),f=a.useRef(null),y=a.useRef(null),{windowInnerWidth:v}=(0,c.l)(),[E,T]=a.useState("15%"),[N,_]=a.useState("35%"),[D,x]=a.useState("50%"),A=a.useRef(null),O=a.useRef(null),w=a.useRef(null),{isDragging:P}=(0,u.N)(A.current,a.useCallback(e=>{let t=e.clientX/v;T(`${(100*t).toFixed(2)}%`)},[v])),{isDragging:R}=(0,u.N)(O.current,a.useCallback(e=>{let t=A.current?A.current.getBoundingClientRect().right:0,r=(e.clientX-t)/v;_(`${(100*r).toFixed(2)}%`)},[v])),{isDragging:F}=(0,u.N)(w.current,a.useCallback(e=>{let t=y.current;if(!t)return;let r=(e.clientX-t.getBoundingClientRect().left)/t.clientWidth;x(`${(100*r).toFixed(2)}%`)},[])),V=(0,h.Xr)(C.jI),L=(0,h.Xr)(C.JN),B=a.useCallback(e=>{let t=f.current;document.activeElement!==t&&(e.keyCode===p.Uz.FORWARD_SLASH&&t?(t.focus(),e.preventDefault()):e.keyCode===p.Uz.BRACKET_LEFT?(s.az.trackDefinedEvent("figmascope.select_prev_next",{direction:"prev",source:"keyboard"}),V()):e.keyCode===p.Uz.BRACKET_RIGHT&&(s.az.trackDefinedEvent("figmascope.select_prev_next",{direction:"next",source:"keyboard"}),L()))},[V,L]),G=(0,d.md)(C.AJ),M=(0,d.md)(C.Nq),U=(0,d.md)(b.s3),$=(0,d.md)(k),K=a.useMemo(()=>{let e;if(M&&(e=M.computedProperties(),$.status===m.r.SUCCESS)){if("DOCUMENT"===M.nodeType())e=[...e,(0,S.f3)($.value)];else{let t=$.value.get(M.guidStr());t&&t.length&&(e=[...e,(0,S.Wh)(t)])}}return e??[]},[M,$]),H=(0,d.md)(I.Ah);return(a.useEffect(()=>{H&&s.az.trackDefinedEvent("figmascope.used",{scene_type:(()=>{switch(H.type){case"server_checkpoint":return"checkpoint";case"server_checkpoint_diff":case"local_diff_file":return"diff";case"multiplayer_journal":case"multiplayer_journals":return"multiplayer_journal";case"server_file":case"local_file":case"pasted_data":break;default:(0,o.j)(H)}return"file"})(),embedded:!!e,backend:"backend"in H?H.backend:"unknown"})},[H,e]),(0,d.md)(I.zm))?a.createElement(C.f.Provider,{value:n??null},a.createElement("div",{className:"figmascope_main_view--root--Bd-g1",style:g.sx.if(P||R||F,{cursor:"ew-resize"}).$,onKeyDown:B},l>1&&a.createElement("div",{className:rx,style:{width:E}},a.createElement(eX,{className:"figmascope_main_view--sceneSwitcherPanel--JLcE9"},a.createElement("div",{ref:A,style:{position:"absolute",top:0,bottom:0,right:"-3px",width:"5px",gridArea:"center",cursor:"ew-resize",zIndex:9}}),a.createElement(rN,null))),a.createElement("div",{className:rx,style:{width:N}},a.createElement(t3,{searchRef:f}),a.createElement(eX,{className:"figmascope_main_view--layersPanel---8k3A"},a.createElement("div",{ref:O,style:{position:"absolute",top:0,bottom:0,right:"-3px",width:"5px",gridArea:"center",cursor:"ew-resize",zIndex:9}}),a.createElement(e7,{pagesList:i}))),a.createElement("div",{className:"figmascope_main_view--right--7jX1p"},a.createElement(rC,{selectedNode:M,diffNode:U,onClose:t}),M&&a.createElement("div",{className:"figmascope_main_view--rightContents--iSsTw",ref:y},a.createElement(eX,{className:"figmascope_main_view--nodeFieldsPanel--spSyC",style:{width:D}},a.createElement("div",{ref:w,style:{position:"absolute",top:0,bottom:0,right:"-3px",width:"5px",gridArea:"center",cursor:"ew-resize",zIndex:9}}),M?a.createElement(ru,{panel:"middle",items:M.nodeFieldProperties(),diffItems:null==U?void 0:U.nodeFieldProperties(),key:G}):a.createElement("h1",null,"Node not found: ",a.createElement(ei,{guid:G}))),a.createElement(eX,{className:"figmascope_main_view--computedPropertiesPanel--No2ua"},M&&a.createElement(ru,{panel:"right",items:K,diffItems:null==U?void 0:U.computedProperties(),key:G})))))):a.createElement(t7.rf,{error:"This scene has no root nodes. This is likely a bug in FigmaScope."})}},71306:(e,t,r)=>{r.d(t,{N:()=>i});var n=r(411855);function i(e,t){let[r,i]=n.useState(!1);return n.useLayoutEffect(()=>{if(!e)return;let r=n=>{i(!1),e.releasePointerCapture(n.pointerId),e.removeEventListener("pointermove",t),e.removeEventListener("pointerup",r)},n=n=>{i(!0),e.setPointerCapture(n.pointerId),e.addEventListener("pointermove",t),e.addEventListener("pointerup",r)};return e.addEventListener("pointerdown",n),()=>{e.removeEventListener("pointerdown",n)}},[t,e]),{isDragging:r}}}}]);
//# debugId=1eff508c-f03e-5972-97b3-3c2e3329152a
//# sourceMappingURL=https://admin.figma.com/admin/webpack-artifacts/fa184f5100ce15675e258d8263fa2422b4c1c3f6/5801-c42987e99b5eac45.min.js.map