(()=>{var e={327(e,t,r){"use strict";r.r(t),r.d(t,{documentSettingForKey:()=>S,globalSettingForKey:()=>a,layerSettingForKey:()=>f,sessionVariable:()=>m,setDocumentSettingForKey:()=>p,setGlobalSettingForKey:()=>c,setLayerSettingForKey:()=>y,setSessionVariable:()=>O,setSettingForKey:()=>l,settingForKey:()=>u});const n=require("util");function o(e){let t=e;if(e&&e.sketchObject){if("Document"!==e.type)throw new Error(`Expected a Document, got a ${e.type}`);t=e._getMSDocumentData()}else e&&e.documentData&&(t=e.documentData());return t}function i(){return __command.pluginBundle()?__command.pluginBundle().identifier():"com.sketchapp.temporary-script"}function a(e){const t=NSUserDefaults.standardUserDefaults().objectForKey_(e);if(void 0!==t&&"undefined"!==t&&null!==t)try{return JSON.parse(t)}catch(e){return n.toJSObject(t)}}function c(e,t){const r=NSUserDefaults.standardUserDefaults(),o=JSON.stringify(t,(e,t)=>n.toJSObject(t));o?r.setObject_forKey_(o,e):r.removeObjectForKey(e)}const s="plugin.sketch.";function u(e){const t=NSUserDefaults.alloc().initWithSuiteName(`${s}${i()}`).objectForKey(e);if(void 0!==t&&"undefined"!=t&&null!==t)return JSON.parse(t)}function l(e,t){const r=NSUserDefaults.alloc().initWithSuiteName(`${s}${i()}`),o=JSON.stringify(t,(e,t)=>n.toJSObject(t));o?r.setObject_forKey_(o,e):r.removeObjectForKey(e)}function d(e){let t;return t=e._isWrappedObject?"DataOverride"===e.type?e.override?.affectedLayer?.sketchObject:"Override"===e.type?e.sketchObject.overrideValue():e.sketchObject:e,t}function f(e,t){const r=__command.valueForKey_onLayer(t,d(e));if(void 0!==r&&"undefined"!=r&&null!==r)return JSON.parse(r)}function y(e,t,r){let o=JSON.stringify(r,(e,t)=>n.toJSObject(t));o||(o=null),__command.setValue_forKey_onLayer(o,t,d(e))}function S(e,t){const r=o(e),n=__command.valueForKey_onDocument(t,r);if(void 0!==n&&"undefined"!=n&&null!==n)return JSON.parse(n)}function p(e,t,r){const i=o(e);let a=JSON.stringify(r,(e,t)=>n.toJSObject(t));a||(a=null),__command.setValue_forKey_onDocument(a,t,i)}function m(e){const t=NSThread.mainThread().threadDictionary().objectForKey(`${s}${i()}.${e}`);if(void 0!==t&&"undefined"!=t&&null!==t)return JSON.parse(t)}function O(e,t){const r=NSThread.mainThread().threadDictionary(),o=JSON.stringify(t,(e,t)=>n.toJSObject(t));o?r.setObject_forKey_(o,`${s}${i()}.${e}`):r.removeObjectForKey(`${s}${i()}.${e}`)}},351(e,t,r){const n=r(327);e.exports=n,e.exports.default=n,e.exports.version={sketch:BCSketchInfo.shared().metadata().appVersion,api:"2.0.0"}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=r(351);module.exports=n})();