@knapsack/core 4.72.0--canary.5313.31d559e.0 → 4.72.0--canary.5313.a97437c.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/ks-urls.d.ts +21 -3
- package/dist/ks-urls.d.ts.map +1 -1
- package/dist/ks-urls.test.d.ts +2 -0
- package/dist/ks-urls.test.d.ts.map +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# v4.71.17 (Thu Dec 19 2024)
|
2
|
+
|
3
|
+
#### 🏠 Internal
|
4
|
+
|
5
|
+
- restore page view analytics for pattern embeds [#5241](https://github.com/knapsack-labs/app-monorepo/pull/5241) ([@GormanDesign](https://github.com/GormanDesign))
|
6
|
+
- BIG ONE: overhaul Branch mutations in UI KSP-5707 KSP-5708 [#5152](https://github.com/knapsack-labs/app-monorepo/pull/5152) ([@EvanLovely](https://github.com/EvanLovely))
|
7
|
+
|
8
|
+
#### Authors: 2
|
9
|
+
|
10
|
+
- Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
|
11
|
+
- Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
|
12
|
+
|
13
|
+
---
|
14
|
+
|
1
15
|
# v4.71.16 (Thu Dec 05 2024)
|
2
16
|
|
3
17
|
#### 🐛 Bug Fix
|
package/dist/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
'use strict';var r=require('superstruct'),utils=require('@knapsack/utils');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var r__namespace=/*#__PURE__*/_interopNamespace(r);var Kt=Object.create;var be=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty;var s=(e,t)=>be(e,"name",{value:t,configurable:!0});var ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $t=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ut(t))!Wt.call(e,o)&&o!==n&&be(e,o,{get:()=>t[o],enumerable:!(a=Bt(t,o))||a.enumerable});return e};var Ht=(e,t,n)=>(n=e!=null?Kt(Lt(e)):{},$t(be(n,"default",{value:e,enumerable:!0}),e));var Fe=ne(($n,Me)=>{Me.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};});var Ke=ne((Hn,ze)=>{ze.exports=s(function(t){return !t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},"isArrayish");});var Le=ne((Gn,Ue)=>{var Jt=Ke(),Xt=Array.prototype.concat,qt=Array.prototype.slice,Be=Ue.exports=s(function(t){for(var n=[],a=0,o=t.length;a<o;a++){var d=t[a];Jt(d)?n=Xt.call(n,qt.call(d)):n.push(d);}return n},"swizzle");Be.wrap=function(e){return function(){return e(Be(arguments))}};});var je=ne((Xn,He)=>{var G=Fe(),J=Le(),We=Object.hasOwnProperty,$e=Object.create(null);for(ae in G)We.call(G,ae)&&($e[G[ae]]=ae);var ae,_=He.exports={to:{},get:{}};_.get=function(e){var t=e.substring(0,3).toLowerCase(),n,a;switch(t){case"hsl":n=_.get.hsl(e),a="hsl";break;case"hwb":n=_.get.hwb(e),a="hwb";break;default:n=_.get.rgb(e),a="rgb";break}return n?{model:a,value:n}:null};_.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,d=/^(\w+)$/,c=[0,0,0,1],l,p,E;if(l=e.match(n)){for(E=l[2],l=l[1],p=0;p<3;p++){var re=p*2;c[p]=parseInt(l.slice(re,re+2),16);}E&&(c[3]=parseInt(E,16)/255);}else if(l=e.match(t)){for(l=l[1],E=l[3],p=0;p<3;p++)c[p]=parseInt(l[p]+l[p],16);E&&(c[3]=parseInt(E+E,16)/255);}else if(l=e.match(a)){for(p=0;p<3;p++)c[p]=parseInt(l[p+1],0);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else if(l=e.match(o)){for(p=0;p<3;p++)c[p]=Math.round(parseFloat(l[p+1])*2.55);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else return (l=e.match(d))?l[1]==="transparent"?[0,0,0,0]:We.call(G,l[1])?(c=G[l[1]],c[3]=1,c):null:null;for(p=0;p<3;p++)c[p]=O(c[p],0,255);return c[3]=O(c[3],0,1),c};_.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.to.hex=function(){var e=J(arguments);return "#"+ie(e[0])+ie(e[1])+ie(e[2])+(e[3]<1?ie(Math.round(e[3]*255)):"")};_.to.rgb=function(){var e=J(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};_.to.rgb.percent=function(){var e=J(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+a+"%)":"rgba("+t+"%, "+n+"%, "+a+"%, "+e[3]+")"};_.to.hsl=function(){var e=J(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};_.to.hwb=function(){var e=J(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};_.to.keyword=function(e){return $e[e.slice(0,3)]};function O(e,t,n){return Math.min(Math.max(t,e),n)}s(O,"clamp");function ie(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s(ie,"hexDouble");});var Oe=["CLEAN_DRAFT","DRAFT"],jt=[...Oe,"PROPOSED"],Gt=["DELETED","PUBLISHED","PUBLISHING"],Kn=s(({instanceStatus:e})=>!Gt.includes(e),"canInstanceStatusBeAccessed"),Bn=s(({instanceStatus:e})=>Oe.includes(e),"canInstanceStatusEdit"),Un=s(({instanceStatus:e})=>jt.includes(e),"canInstanceStatusPublish");var st=Ht(je());var Qe=Symbol.for("immer-nothing"),Ge=Symbol.for("immer-draftable"),C=Symbol.for("immer-state"),Yt=process.env.NODE_ENV!=="production"?[function(e){return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return `'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return `'original' expects a draft, got: ${e}`}]:[];function S(e,...t){if(process.env.NODE_ENV!=="production"){let n=Yt[e],a=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${a}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}s(S,"die");var W=Object.getPrototypeOf;function M(e){return !!e&&!!e[C]}s(M,"isDraft");function K(e){return e?Ze(e)||Array.isArray(e)||!!e[Ge]||!!e.constructor?.[Ge]||ce(e)||de(e):!1}s(K,"isDraftable");var Qt=Object.prototype.constructor.toString();function Ze(e){if(!e||typeof e!="object")return !1;let t=W(e);if(t===null)return !0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Qt}s(Ze,"isPlainObject");function se(e,t){ue(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e);}):e.forEach((n,a)=>t(a,n,e));}s(se,"each");function ue(e){let t=e[C];return t?t.type_:Array.isArray(e)?1:ce(e)?2:de(e)?3:0}s(ue,"getArchtype");function ke(e,t){return ue(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}s(ke,"has");function et(e,t,n){let a=ue(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n;}s(et,"set");function Zt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}s(Zt,"is");function ce(e){return e instanceof Map}s(ce,"isMap");function de(e){return e instanceof Set}s(de,"isSet");function z(e){return e.copy_||e.base_}s(z,"latest");function _e(e,t){if(ce(e))return new Map(e);if(de(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Ze(e);if(t===!0||t==="class_only"&&!n){let a=Object.getOwnPropertyDescriptors(e);delete a[C];let o=Reflect.ownKeys(a);for(let d=0;d<o.length;d++){let c=o[d],l=a[c];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(a[c]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[c]});}return Object.create(W(e),a)}else {let a=W(e);if(a!==null&&n)return {...e};let o=Object.create(a);return Object.assign(o,e)}}s(_e,"shallowCopy");function Ae(e,t=!1){return pe(e)||M(e)||!K(e)||(ue(e)>1&&(e.set=e.add=e.clear=e.delete=er),Object.freeze(e),t&&Object.entries(e).forEach(([n,a])=>Ae(a,!0))),e}s(Ae,"freeze");function er(){S(2);}s(er,"dontMutateFrozenCollections");function pe(e){return Object.isFrozen(e)}s(pe,"isFrozen");var tr={};function B(e){let t=tr[e];return t||S(0,e),t}s(B,"getPlugin");var X;function tt(){return X}s(tt,"getCurrentScope");function rr(e,t){return {drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}s(rr,"createScope");function Je(e,t){t&&(B("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t);}s(Je,"usePatchesInScope");function Ce(e){Te(e),e.drafts_.forEach(nr),e.drafts_=null;}s(Ce,"revokeScope");function Te(e){e===X&&(X=e.parent_);}s(Te,"leaveScope");function Xe(e){return X=rr(X,e)}s(Xe,"enterScope");function nr(e){let t=e[C];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0;}s(nr,"revokeDraft");function qe(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[C].modified_&&(Ce(t),S(4)),K(e)&&(e=oe(t,e),t.parent_||le(t,e)),t.patches_&&B("Patches").generateReplacementPatches_(n[C].base_,e,t.patches_,t.inversePatches_)):e=oe(t,n,[]),Ce(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Qe?e:void 0}s(qe,"processResult");function oe(e,t,n){if(pe(t))return t;let a=t[C];if(!a)return se(t,(o,d)=>Ye(e,a,t,o,d,n)),t;if(a.scope_!==e)return t;if(!a.modified_)return le(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let o=a.copy_,d=o,c=!1;a.type_===3&&(d=new Set(o),o.clear(),c=!0),se(d,(l,p)=>Ye(e,a,o,l,p,n,c)),le(e,o,!1),n&&e.patches_&&B("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_);}return a.copy_}s(oe,"finalize");function Ye(e,t,n,a,o,d,c){if(process.env.NODE_ENV!=="production"&&o===n&&S(5),M(o)){let l=d&&t&&t.type_!==3&&!ke(t.assigned_,a)?d.concat(a):void 0,p=oe(e,o,l);if(et(n,a,p),M(p))e.canAutoFreeze_=!1;else return}else c&&n.add(o);if(K(o)&&!pe(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;oe(e,o),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,a)&&le(e,o);}}s(Ye,"finalizeProperty");function le(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ae(t,n);}s(le,"maybeFreeze");function ar(e,t){let n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:tt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=a,d=Ee;n&&(o=[a],d=q);let{revoke:c,proxy:l}=Proxy.revocable(o,d);return a.draft_=l,a.revoke_=c,l}s(ar,"createProxyProxy");var Ee={get(e,t){if(t===C)return e;let n=z(e);if(!ke(n,t))return ir(e,n,t);let a=n[t];return e.finalized_||!K(a)?a:a===Se(e.base_,t)?(ve(e),e.copy_[t]=xe(a,e)):a},has(e,t){return t in z(e)},ownKeys(e){return Reflect.ownKeys(z(e))},set(e,t,n){let a=rt(z(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){let o=Se(z(e),t),d=o?.[C];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Zt(n,o)&&(n!==void 0||ke(e.base_,t)))return !0;ve(e),we(e);}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Se(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ve(e),we(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=z(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){S(11);},getPrototypeOf(e){return W(e.base_)},setPrototypeOf(){S(12);}},q={};se(Ee,(e,t)=>{q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};});q.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&S(13),q.set.call(this,e,t,void 0)};q.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&S(14),Ee.set.call(this,e[0],t,n,e[0])};function Se(e,t){let n=e[C];return (n?z(n):e)[t]}s(Se,"peek");function ir(e,t,n){let a=rt(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}s(ir,"readPropFromProto");function rt(e,t){if(!(t in e))return;let n=W(e);for(;n;){let a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=W(n);}}s(rt,"getDescriptorFromProto");function we(e){e.modified_||(e.modified_=!0,e.parent_&&we(e.parent_));}s(we,"markChanged");function ve(e){e.copy_||(e.copy_=_e(e.base_,e.scope_.immer_.useStrictShallowCopy_));}s(ve,"prepareCopy");var sr=class{static{s(this,"Immer2");}constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){let d=n;n=t;let c=this;return s(function(p=d,...E){return c.produce(p,re=>n.call(this,re,...E))},"curriedProduce")}typeof n!="function"&&S(6),a!==void 0&&typeof a!="function"&&S(7);let o;if(K(t)){let d=Xe(this),c=xe(t,void 0),l=!0;try{o=n(c),l=!1;}finally{l?Ce(d):Te(d);}return Je(d,a),qe(o,d)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Qe&&(o=void 0),this.autoFreeze_&&Ae(o,!0),a){let d=[],c=[];B("Patches").generateReplacementPatches_(t,o,d,c),a(d,c);}return o}else S(1,t);},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return (c,...l)=>this.produceWithPatches(c,p=>t(p,...l));let a,o;return [this.produce(t,n,(c,l)=>{a=c,o=l;}),a,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy);}createDraft(e){K(e)||S(8),M(e)&&(e=or(e));let t=Xe(this),n=xe(e,void 0);return n[C].isManual_=!0,Te(t),n}finishDraft(e,t){let n=e&&e[C];(!n||!n.isManual_)&&S(9);let{scope_:a}=n;return Je(a,t),qe(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e;}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e;}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let a=B("Patches").applyPatches_;return M(e)?a(e,t):this.produce(e,o=>a(o,t))}};function xe(e,t){let n=ce(e)?B("MapSet").proxyMap_(e,t):de(e)?B("MapSet").proxySet_(e,t):ar(e,t);return (t?t.scope_:tt()).drafts_.push(n),n}s(xe,"createProxy");function or(e){return M(e)||S(10,e),nt(e)}s(or,"current");function nt(e){if(!K(e)||pe(e))return e;let t=e[C],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_e(e,t.scope_.immer_.useStrictShallowCopy_);}else n=_e(e,!0);return se(n,(a,o)=>{et(n,a,nt(o));}),t&&(t.finalized_=!1),n}s(nt,"currentImpl");var T=new sr;T.produceWithPatches.bind(T);T.setAutoFreeze.bind(T);T.setUseStrictShallowCopy.bind(T);T.applyPatches.bind(T);T.createDraft.bind(T);T.finishDraft.bind(T);var cr=Object.defineProperty,u=s((e,t)=>cr(e,"name",{value:t,configurable:!0}),"n");function ot(e){if(typeof e!="string")return !1;try{return !!st.default.get(e)}catch{return !1}}s(ot,"Ne");u(ot,"isColor");var me=r.define("ColorStringStruct",e=>typeof e=="string"&&ot(e)),y=r.union([r.type({type:r.literal("value"),colorValue:me}),r.type({type:r.literal("design-token"),tokenName:r.string()})]);r.type({type:r.literal("design-token"),tokenName:r.string()});var at=r.object({unit:r.enums(["rem","px"]),value:r.number()}),it=r.union([r.string(),r.number()]),dr=(e=>(e.woff2="woff2",e.woff="woff",e))(dr||{}),pr=r.enums(["woff2","woff"]),fr=r.type({format:pr,type:r.literal("url"),path:r.string()}),ee=r.type({family:r.optional(r.string()),weight:r.optional(r.union([it,r.size(r.array(it),2)])),src:r.optional(r.array(fr)),style:r.optional(r.string()),display:r.optional(r.enums(["auto","block","swap","fallback","optional"])),variationSettings:r.optional(r.string()),unicodeRange:r.optional(r.string())}),mr=(e=>(e.inherit="As typed",e.capitalize="Capitalize",e.lowercase="Lowercase",e.uppercase="Uppercase",e))(mr||{}),gr=(e=>(e["ultra-condensed"]="Ultra-condensed",e["extra-condensed"]="Extra-condensed",e.condensed="Condensed",e["semi-condensed"]="Semi-condensed",e.normal="Normal",e["semi-expanded"]="Semi-expanded",e.expanded="Expanded",e["extra-expanded"]="Extra-expanded",e["ultra-expanded"]="Ultra-expanded",e))(gr||{}),te=r.type({fontWeight:r.optional(r.union([r.string(),r.number()])),textColor:r.optional(y),hoverColor:r.optional(y),underline:r.optional(r.boolean()),textTransform:r.optional(r.enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:r.optional(r.enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))}),yr=r.type({min:at,max:r.optional(at)}),f=r.type({fontSize:r.optional(yr),lineHeight:r.optional(r.union([r.string(),r.number()])),fontWeight:r.optional(r.union([r.string(),r.number()])),letterSpacing:r.optional(r.string()),fontFamily:r.optional(r.string()),textColor:r.optional(y),textTransform:r.optional(r.enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:r.optional(r.enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))});var j=r.union([f,r.type({accentColor:r.optional(y)})]),ge=r.union([j,r.type({hoverColor:r.optional(y),backgroundColor:r.optional(y)})]),ye=r.union([j,r.type({backgroundColor:r.optional(y)})]);r.object({version:r.literal(1),oldSillySidebarBgColor:me});r.object({version:r.literal(2),anotherSillySidebarBgColor:me});r.object({version:r.literal(3),sidebarBgColor:me});r.object({version:r.literal(4),primaryColor:y,darkColor:y,lightColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0))});r.object({version:r.literal(5),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0))});r.object({version:r.literal(6),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0)),appearance:r.type({customFonts:r.optional(r.array(ee)),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(7),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0)),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ge),secondaryNav:r.optional(ye),tabs:r.optional(j)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(8),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ge),secondaryNav:r.optional(ye),tabs:r.optional(j)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(9),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ge),secondaryNav:r.optional(ye),tabs:r.optional(j)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(10),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ge),secondaryNav:r.optional(ye),tabs:r.optional(j)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingXLarge:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),headingXSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});function lt(e){return typeof e!="string"?!1:e.split("{").length-1===1&&e.startsWith("{")&&e.endsWith("}")}s(lt,"He");u(lt,"isTokenReference");function P(e){return typeof e=="string"&&e.includes("{")}s(P,"x");u(P,"hasTokenReferences");function ut(e){return !lt(e)}s(ut,"Je");u(ut,"isNotTokenReference");var h=r__namespace.define("Token Reference",e=>typeof e!="string"?!1:ut(e)?"Must start and end with curly braces":!0),hr={border:"border",shadow:"shadow",transition:"transition"},br=Object.values(hr),Sr={string:"string",number:"number",boolean:"boolean",color:"color",dimension:"dimension",duration:"duration",fontWeight:"fontWeight",strokeStyle:"strokeStyle",cubicBezier:"cubicBezier"},vr=Object.values(Sr);function Ie(e){return br.includes(e)}s(Ie,"J");u(Ie,"isTokenTypeComposite");function ct(e){return vr.includes(e)}s(ct,"ye");u(ct,"isTokenTypeSingular");utils.expectType([{inset:!1,color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px"},{color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px",inset:!0}]);var b=r__namespace.type({id:r__namespace.string(),description:r__namespace.optional(r__namespace.string()),references:r__namespace.optional(r__namespace.array(r__namespace.array(r__namespace.string()))),tokenConfig:r__namespace.optional(r__namespace.type({purpose:r__namespace.optional(r__namespace.string())}))});utils.expectType([{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"static"},{type:"duration",value:"1ms",kind:"ref",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"ref"},{type:"duration",value:"1ms",kind:"static",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"color",value:"#000",kind:"static",id:"1",originalValue:"#000"},{type:"color",value:"#000",kind:"ref",id:"1",originalValue:"{c.b}",referencedTokenId:"c.b"},{type:"cubicBezier",kind:"static",value:[0,0,0,1],originalValue:[0,0,0,1],id:"1"}]);function kr(e){return Ie(e.type)}s(kr,"un");u(kr,"isTokenDataComposite");utils.expectType([{type:"border",kind:"static",id:"1",value:{color:"#000",style:"solid",width:"1px"},originalValue:{color:"#000",style:"solid",width:"1px"}},{type:"border",kind:"ref",referencedTokenId:"a.b",id:"1",value:{color:"red",style:"dashed",width:"2px"},originalValue:"{a.b}"},{type:"shadow",value:{color:"#000",offsetX:"1px",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},originalValue:{color:"#000",offsetX:"{a.a}",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},id:"1",kind:"static"},{type:"shadow",kind:"ref",referencedTokenId:"a.b",value:{inset:!0,color:"red",offsetX:"1px",blur:"2px",offsetY:"3px",spread:"4px"},originalValue:"{a.b}",id:"1"},{type:"transition",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:"{a.b}",kind:"ref",referencedTokenId:"a.b",id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"{a.c}",timingFunction:"{a.c}"},id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},id:"1"}]);function dt(e){return typeof e=="string"&&!P(e)}s(dt,"et");u(dt,"isTokenValueColor");var $=r__namespace.define("Color Value",e=>typeof e!="string"?"Value must be a string":e===""?"Value must not be empty":P(e)?"Value must not contain {} (token references)":!0),_r=r__namespace.assign(r__namespace.type({type:r__namespace.literal("color"),value:$,kind:r__namespace.literal("static"),originalValue:$}),b),Cr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("color"),value:$,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Y(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("rem"))&&!P(e)}s(Y,"Y");u(Y,"isTokenValueDimension");var D=r__namespace.define("Dimension Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":!e.endsWith("px")&&!e.endsWith("rem")&&!e.endsWith("em")&&!e.endsWith("%")?"Value must end with px, rem, em or %":!0),Tr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("dimension"),value:D,kind:r__namespace.literal("static"),originalValue:D}),b),wr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("dimension"),value:D,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function xr(e){return typeof e=="string"&&e.endsWith("ms")&&!P(e)}s(xr,"gn");u(xr,"isTokenValueDuration");var L=r__namespace.define("Duration Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":/^\d+ms$/.test(e)?!0:'Value must be a number followed by "ms" (e.g., "100ms")'),Ar=r__namespace.assign(r__namespace.type({type:r__namespace.literal("duration"),value:L,kind:r__namespace.literal("static"),originalValue:L}),b),Er=r__namespace.assign(r__namespace.type({type:r__namespace.literal("duration"),value:L,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Dr(e){return (typeof e=="string"||typeof e=="number")&&!P(e)}s(Dr,"fn");u(Dr,"isTokenValueFontWeight");var De=r__namespace.define("Font Weight Value",e=>typeof e!="string"&&typeof e!="number"?"Value must be a string or number":P(e)?"Value must not contain {} (token references)":!0),Nr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("fontWeight"),value:De,kind:r__namespace.literal("static"),originalValue:De}),b),Ir=r__namespace.assign(r__namespace.type({type:r__namespace.literal("fontWeight"),value:De,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Q=r__namespace.define("Cubic Bezier Value",e=>Array.isArray(e)?e.length!==4||!e.every(t=>typeof t=="number")?"Value must be an array of 4 numbers":e[0]<0||e[0]>1||e[2]<0||e[2]>1?"The first and third cubicBezier values must be between 0 and 1":!0:"Value must be an array"),Vr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("cubicBezier"),value:Q,kind:r__namespace.literal("static"),originalValue:Q}),b),Pr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("cubicBezier"),value:Q,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function pt(e){return utils.isObject(e)&&dt(e.color)&&Y(e.offsetX)&&Y(e.offsetY)&&Y(e.blur)&&Y(e.spread)}s(pt,"ut");u(pt,"isTokenValueShadow");var ft=r__namespace.define("Shadow Value",e=>pt(e)?!0:`Expected a shadow value, got ${JSON.stringify(e)}`),Rr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("shadow"),value:ft,kind:r__namespace.literal("static"),originalValue:r__namespace.type({color:r__namespace.union([$,h]),offsetX:r__namespace.union([D,h]),offsetY:r__namespace.union([D,h]),blur:r__namespace.union([D,h]),spread:r__namespace.union([D,h]),inset:r__namespace.union([r__namespace.optional(r__namespace.boolean()),h])})}),b),Or=r__namespace.assign(r__namespace.type({type:r__namespace.literal("shadow"),value:ft,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),H=r__namespace.union([r__namespace.literal("solid"),r__namespace.literal("dashed"),r__namespace.literal("dotted"),r__namespace.literal("double"),r__namespace.literal("groove"),r__namespace.literal("ridge"),r__namespace.literal("outset"),r__namespace.literal("inset")]);function mt(e){return utils.isObject(e)&&$.is(e.color)&&H.is(e.style)&&D.is(e.width)}s(mt,"mt");u(mt,"isTokenValueBorder");var gt=r__namespace.define("Border Value",mt),Mr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("border"),value:gt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({color:r__namespace.union([$,h]),style:r__namespace.union([H,h]),width:r__namespace.union([D,h])})}),b),Fr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("border"),value:gt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function yt(e){return utils.isObject(e)&&Q.is(e.timingFunction)&&L.is(e.duration)&&L.is(e.delay)}s(yt,"kt");u(yt,"isTokenValueTransition");var ht=r__namespace.define("Transition Value",yt),zr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("transition"),value:ht,kind:r__namespace.literal("static"),originalValue:r__namespace.type({timingFunction:r__namespace.union([Q,h]),duration:r__namespace.union([L,h]),delay:r__namespace.union([L,h])})}),b),Kr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("transition"),value:ht,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Br=r__namespace.assign(r__namespace.type({type:r__namespace.literal("string"),value:r__namespace.string(),kind:r__namespace.literal("static"),originalValue:r__namespace.string()}),b),Ur=r__namespace.assign(r__namespace.type({type:r__namespace.literal("string"),value:r__namespace.string(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Lr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("strokeStyle"),value:H,kind:r__namespace.literal("static"),originalValue:H}),b),Wr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("strokeStyle"),value:H,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:H}),b),$r=r__namespace.assign(r__namespace.type({type:r__namespace.literal("number"),value:r__namespace.number(),kind:r__namespace.literal("static"),originalValue:r__namespace.number()}),b),Hr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("number"),value:r__namespace.number(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),jr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("boolean"),value:r__namespace.boolean(),kind:r__namespace.literal("static"),originalValue:r__namespace.boolean()}),b),Gr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("boolean"),value:r__namespace.boolean(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);u(e=>{if(!utils.isObject(e))throw new Error(`Expected token data to be an object, got ${JSON.stringify(e)}`);if(!utils.isObjKey("type",e))throw new Error(`Expected token data to have a "type" property, got ${JSON.stringify(e)}`);if(typeof e.type!="string")throw new Error(`Expected token data "type" property to be a string, got ${JSON.stringify(e)}`);let t=e.type,n=e.kind;try{switch(t){case"boolean":n==="ref"?Gr.assert(e):jr.assert(e);return;case"border":n==="ref"?Fr.assert(e):Mr.assert(e);return;case"color":n==="ref"?Cr.assert(e):_r.assert(e);return;case"cubicBezier":n==="ref"?Pr.assert(e):Vr.assert(e);return;case"dimension":n==="ref"?wr.assert(e):Tr.assert(e);return;case"duration":n==="ref"?Er.assert(e):Ar.assert(e);return;case"fontWeight":n==="ref"?Ir.assert(e):Nr.assert(e);return;case"number":n==="ref"?Hr.assert(e):$r.assert(e);return;case"shadow":n==="ref"?Or.assert(e):Rr.assert(e);return;case"string":n==="ref"?Ur.assert(e):Br.assert(e);return;case"strokeStyle":n==="ref"?Wr.assert(e):Lr.assert(e);return;case"transition":n==="ref"?Kr.assert(e):zr.assert(e);return;default:throw new Error(`Unknown token data type: ${t}`)}}catch(a){throw a instanceof r__namespace.StructError?new Error(`Invalid token data for type "${t}": ${a.message}. Received this data: "${JSON.stringify(e)}"`):a}},"assertTokenData");utils.expectType([{type:"dimension",kind:"static",value:"1px"},{type:"dimension",kind:"ref",referencedTokenId:"a.b"}]);utils.expectType([{type:"border",kind:"ref",referencedTokenId:"a.b"},{type:"border",kind:"static",value:{color:{kind:"static",type:"color",value:"red"},style:{kind:"ref",type:"strokeStyle",referencedTokenId:""},width:{kind:"static",type:"dimension",value:"2px"}}}]);utils.expectType([{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function Jr(e){return ct(e?.type)}s(Jr,"Dn");u(Jr,"isTokenSrcValueInfoSingular");function Xr(e){return Ie(e?.type)}s(Xr,"hn");u(Xr,"isTokenSrcValueInfoComposite");utils.expectType([{type:"dimension",kind:"static",value:"1px"},{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"ref",value:"1px"},{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function bt(e){return utils.isObject(e)&&utils.isObjKey("cloud.knapsack",e)}s(bt,"Rt");u(bt,"isTokenSrcExtensions");utils.expectType(["#ddd",!0,[83,1,1,1],{color:"#000",style:"solid",width:"1px"},{inset:!0,color:"#000",offsetX:"0px",offsetY:"{spacing.medium}",spread:"0px",blur:"0px"},{timingFunction:"{timing.ease}",duration:"{timing.duration.medium}",delay:"7ms",color:"#000"}]);function qr(e){return !!(utils.isObject(e)&&utils.isObjKey("$value",e))}s(qr,"Rn");u(qr,"isTokenSrc");function St(e){return utils.isObject(e)&&!bt(e)&&!utils.isObjKey("$value",e)&&!utils.isObjKey("cloud.knapsack",e)}s(St,"Bt");u(St,"isTokenGroup");function Yr(e){if(St(e)){let t=e.$extensions["cloud.knapsack"].group.collectionInfo;if(utils.isObjKey("type",t)&&utils.isObjKey("referenceId",t))return !0}return !1}s(Yr,"Bn");u(Yr,"isTokenTypeVarRef");function Qr(e){let t=typeof e;if(t==="string"||t==="number"||t==="boolean")return t;throw new Error(`Invalid token value type: ${JSON.stringify(t)}. Token value is: ${JSON.stringify(e)}`)}s(Qr,"An");u(Qr,"getPrimitiveValue");u(e=>e.includes("px")||e.includes("rem")||e.includes("em")||e.includes("%"),"isDimensionString");function Zr(e){let{value:t,unit:n}=utils.parseNumberWithUnit(e);if(!n)return {value:t};if(n!=="px"&&n!=="rem"&&n!=="em"&&n!=="%")throw new Error(`Invalid unit "${n}" for value: ${t}`);return {value:t,unit:n}}s(Zr,"Kn");u(Zr,"parseTokenDimensionValue");u(e=>utils.isObject(e)&&e.type==="text","isSlottedText");function en(e){return utils.isObject(e)&&e.type==="template-demo"}s(en,"jn");u(en,"isSlottedTemplateDemo");function tn(e){return utils.isObject(e)&&e.type==="template-reference"}s(tn,"Wn");u(tn,"isSlottedTemplateReference");var rn=(e=>(e.portrait="portrait",e.landscape="landscape",e))(rn||{});function nn(e){return e?.type==="data"}s(nn,"Ln");u(nn,"isDataDemo");function an(e){return e?.type==="template"}s(an,"_n");u(an,"isTemplateDemo");var sn=(e=>(e.auto="auto",e.small="small",e.medium="medium",e.large="large",e.full="full",e))(sn||{});function vt(e){return !utils.isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","db"].every(t=>utils.isObjKey(t,e))?!1:!utils.isObjKey("metaState",e)}s(vt,"At");u(vt,"isKsAppClientDataNoMeta");r.define("KsAppClientDataNoMeta",vt);function kt(e){return utils.isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","metaState","db"].every(t=>utils.isObjKey(t,e)):!1}s(kt,"Ot");u(kt,"isKsAppClientDataAndMeta");r.define("KsAppClientDataAndMeta",kt);r.type({isLocalDev:r.boolean(),plugins:r.array(r.type({id:r.string(),hasContent:r.boolean(),clientPluginPath:r.optional(r.string()),cssPath:r.optional(r.string())})),meta:r.optional(r.type({version:r.optional(r.string()),hasKnapsackCloud:r.boolean(),knapsackCloudSiteId:r.optional(r.string()),serverPort:r.optional(r.number()),websocketsPort:r.optional(r.number()),https:r.optional(r.boolean()),cacheDir:r.optional(r.string()),ksVersions:r.type({app:r.string()})}))});function _t(e){return !utils.isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState"].every(t=>utils.isObjKey(t,e))?!1:!utils.isObjKey("metaState",e)}s(_t,"Ut");u(_t,"isKsAppClientDataNoMetaV3");r.define("KsAppClientDataNoMeta",_t);function Ct(e){return utils.isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState","metaState"].every(t=>utils.isObjKey(t,e)):!1}s(Ct,"zt");u(Ct,"isKsAppClientDataAndMetaV3");r.define("KsAppClientDataAndMeta",Ct);r.type({isLocalDev:r.boolean(),plugins:r.array(r.type({id:r.string(),hasContent:r.boolean(),clientPluginPath:r.optional(r.string()),cssPath:r.optional(r.string())})),meta:r.optional(r.type({version:r.optional(r.string()),hasKnapsackCloud:r.boolean(),knapsackCloudSiteId:r.optional(r.string()),serverPort:r.optional(r.number()),websocketsPort:r.optional(r.number()),https:r.optional(r.boolean()),cacheDir:r.optional(r.string()),ksVersions:r.type({app:r.string()})}))});({version:"4.1.7",checkIfNeeded:u(e=>!0,"checkIfNeeded"),migrate:u(e=>{if(!M(e))throw new Error("Tried to run migrations on appClientData but it is not an Immer Draft");Object.values(e.patternsState.patterns).forEach(t=>{delete t.demoSize;}),Object.values(e.db.demos.byId).forEach(t=>{t.type==="data"&&(Object.entries(t.data.slots??{}).forEach(([n,a])=>{t.data.slots[n]=a.map(o=>typeof o=="string"?{type:"text",text:o}:(o.type==="template-reference"||o.type==="text"||(o.type="template-demo"),o));}),!(t.patternId&&t.templateId)&&(()=>{for(let{id:n,templates:a=[]}of Object.values(e.patternsState.patterns))for(let{id:o,demoIds:d=[]}of a)if(d.includes(t.id)){t.patternId=n,t.templateId=o;return}})());});},"migrate")});var un=(e=>(e.string="string",e.boolean="boolean",e.number="number",e.object="object",e.options="options",e.function="function",e.customTypeScript="customTypeScript",e.array="array",e.arrayOfObjects="arrayOfObjects",e.arrayOfStrings="arrayOfStrings",e.arrayOfNumbers="arrayOfNumbers",e.unknown="unknown",e))(un||{});u(e=>"type"in e&&e.type==="string"&&!("enum"in e),"isStringProp");u(e=>"type"in e&&e.type==="number","isNumberProp");u(e=>"type"in e&&e.type==="boolean","isBooleanProp");u(e=>"enum"in e,"isOptionsProp");u(e=>"typeof"in e&&e?.typeof==="function","isFunctionProp");u(e=>!("typeof"in e)&&"tsType"in e,"isCustomTypeScriptProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="object","isArrayOfObjectsProp");u(e=>"type"in e&&e.type==="object"&&"properties"in e&&Object.keys(e.properties).length>0,"isObjectProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="string","isArrayOfStringsProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="number","isArrayOfNumbersProp");var Tt=r__namespace.object({op:r__namespace.union([r__namespace.literal("replace"),r__namespace.literal("remove"),r__namespace.literal("add")]),path:r__namespace.array(r__namespace.union([r__namespace.string(),r__namespace.number()])),value:r__namespace.optional(r__namespace.any())}),cn=Tt;u(e=>cn.is(e),"isPatch");var Ne=r__namespace.array(Tt),dn=Ne;u(e=>dn.is(e),"isPatches");var wt=r__namespace.type({patches:Ne,inversePatches:r__namespace.optional(Ne),event:r__namespace.optional(r__namespace.object({type:r__namespace.string()})),id:r__namespace.string(),date:r__namespace.string(),userId:r__namespace.optional(r__namespace.string())}),pn=wt;u(e=>pn.is(e),"isKsRemoteChange");var fn=r__namespace.array(wt),mn=fn;u(e=>mn.is(e),"isKsRemoteChanges");var gn=(e=>(e.ready="ready",e))(gn||{});var yn=(e=>(e.GitHub="GitHub",e.GitLab="GitLab",e.GitLabRest="GitLabRest",e.Bitbucket="Bitbucket",e.Azure="Azure",e))(yn||{}),hn=(e=>(e.Conflicting="CONFLICTING",e.Mergeable="MERGEABLE",e.Unknown="UNKNOWN",e))(hn||{}),bn=(e=>(e.Create="CREATE",e.Move="MOVE",e.Update="UPDATE",e.Chmod="CHMOD",e))(bn||{}),Sn=(e=>(e.Base64="BASE64",e.Text="TEXT",e))(Sn||{}),vn={ADMIN:"ADMIN",ANONYMOUS:"ANONYMOUS",CONTRIBUTOR:"CONTRIBUTOR",EDITOR:"EDITOR",MANAGER:"MANAGER",VIEWER:"VIEWER"},xt=Object.values(vn);var Vt=r.enums(xt),Tn=Vt,Za=s(e=>e==="ADMIN","canRoleAdmin"),Pt=["ADMIN","MANAGER"],ei=s(e=>Pt.includes(e),"canRoleManageUsers"),Rt=[...Pt,"EDITOR"],ti=s(e=>Rt.includes(e),"canRoleDelete"),Ot=[...Rt,"CONTRIBUTOR"],ri=s(e=>Ot.includes(e),"canRoleEdit"),wn=["ADMIN"],ni=s(e=>wn.includes(e),"canRolePublish"),xn=[...Ot,"VIEWER"],ai=s(e=>xn.includes(e),"canRoleView"),An=s(e=>Tn.is(e),"isRoleValid"),Mt=(n=>(n.user="user",n.anonymous="anonymous",n))(Mt||{}),Dt=r.enums(Object.values(Mt)),En=r.object({"x-hasura-allowed-roles":r.array(Dt),"x-hasura-default-role":Dt,"x-hasura-user-id":r.optional(r.string())}),Dn=r.object({userId:r.string(),isSuperAdmin:r.boolean(),sitesByRole:r.record(Vt,r.array(r.string()))}),Nn=r.type({exp:r.number(),email:r.optional(r.string()),email_verified:r.optional(r.union([r.string(),r.boolean()])),iat:r.number(),iss:r.string(),sub:r.string(),aud:r.union([r.string(),r.array(r.string())])}),In="https://hasura.io/jwt/claims",Ft="https://knapsack.cloud",Vn=r.object({[In]:En,[Ft]:Dn}),Pn=r.assign(Nn,Vn);function Rn(e){return Object.entries(e).reduce((t,[n,a])=>(An(n)&&a.forEach(o=>{t[o]=n;}),t),{})}s(Rn,"expandSitesByRole");var On={isSuperAdmin:!1,userId:"",siteRoleMap:{},getSiteRole:s(()=>"ANONYMOUS","getSiteRole")},ii=s(e=>{if(!Pn.is(e))return On;let{sitesByRole:t,...n}=e[Ft],a=Rn(t);return {...n,siteRoleMap:a,getSiteRole:s(o=>n.isSuperAdmin?"ADMIN":a[o]||"ANONYMOUS","getSiteRole")}},"getKsClaims");var li="/site-deployed",ui="/github-auth";var{KS_DB_URL:he}=process.env;if(he&&!utils.isUrl(he))throw new Error(`KS_DB_URL is not a valid URL: '${he}'`);var zt=he||"https://db.knapsack.cloud",Fn=new URL("/v1/graphql",zt).toString(),pi={dbUrl:zt,dbGqlEndpoint:Fn};var mi={siteId:"X-KS-Site-ID",instanceId:"X-KS-Instance-Id",appClientVersion:"X-KS-App-Client-Version",requestId:"X-KS-Request-Id"};
|
2
|
-
exports.HASURA_CLAIMS_NAMESPACE=
|
1
|
+
'use strict';var r=require('superstruct'),utils=require('@knapsack/utils');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var r__namespace=/*#__PURE__*/_interopNamespace(r);var Ft=Object.create;var he=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var s=(e,t)=>he(e,"name",{value:t,configurable:!0});var ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Lt=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Kt(t))!Bt.call(e,o)&&o!==n&&he(e,o,{get:()=>t[o],enumerable:!(a=zt(t,o))||a.enumerable});return e};var Wt=(e,t,n)=>(n=e!=null?Ft(Ut(e)):{},Lt(he(n,"default",{value:e,enumerable:!0}),e));var Me=ne((Un,Oe)=>{Oe.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};});var ze=ne((Bn,Fe)=>{Fe.exports=s(function(t){return !t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},"isArrayish");});var Be=ne((Wn,Ue)=>{var Ht=ze(),jt=Array.prototype.concat,qt=Array.prototype.slice,Ke=Ue.exports=s(function(t){for(var n=[],a=0,o=t.length;a<o;a++){var d=t[a];Ht(d)?n=jt.call(n,qt.call(d)):n.push(d);}return n},"swizzle");Ke.wrap=function(e){return function(){return e(Ke(arguments))}};});var Ge=ne((Gn,$e)=>{var j=Me(),q=Be(),Le=Object.hasOwnProperty,We=Object.create(null);for(ae in j)Le.call(j,ae)&&(We[j[ae]]=ae);var ae,_=$e.exports={to:{},get:{}};_.get=function(e){var t=e.substring(0,3).toLowerCase(),n,a;switch(t){case"hsl":n=_.get.hsl(e),a="hsl";break;case"hwb":n=_.get.hwb(e),a="hwb";break;default:n=_.get.rgb(e),a="rgb";break}return n?{model:a,value:n}:null};_.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,d=/^(\w+)$/,c=[0,0,0,1],l,p,A;if(l=e.match(n)){for(A=l[2],l=l[1],p=0;p<3;p++){var re=p*2;c[p]=parseInt(l.slice(re,re+2),16);}A&&(c[3]=parseInt(A,16)/255);}else if(l=e.match(t)){for(l=l[1],A=l[3],p=0;p<3;p++)c[p]=parseInt(l[p]+l[p],16);A&&(c[3]=parseInt(A+A,16)/255);}else if(l=e.match(a)){for(p=0;p<3;p++)c[p]=parseInt(l[p+1],0);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else if(l=e.match(o)){for(p=0;p<3;p++)c[p]=Math.round(parseFloat(l[p+1])*2.55);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else return (l=e.match(d))?l[1]==="transparent"?[0,0,0,0]:Le.call(j,l[1])?(c=j[l[1]],c[3]=1,c):null:null;for(p=0;p<3;p++)c[p]=O(c[p],0,255);return c[3]=O(c[3],0,1),c};_.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.to.hex=function(){var e=q(arguments);return "#"+ie(e[0])+ie(e[1])+ie(e[2])+(e[3]<1?ie(Math.round(e[3]*255)):"")};_.to.rgb=function(){var e=q(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};_.to.rgb.percent=function(){var e=q(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+a+"%)":"rgba("+t+"%, "+n+"%, "+a+"%, "+e[3]+")"};_.to.hsl=function(){var e=q(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};_.to.hwb=function(){var e=q(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};_.to.keyword=function(e){return We[e.slice(0,3)]};function O(e,t,n){return Math.min(Math.max(t,e),n)}s(O,"clamp");function ie(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s(ie,"hexDouble");});var Re=["CLEAN_DRAFT","DRAFT"],$t=[...Re,"PROPOSED"],Gt=["DELETED","PUBLISHED","PUBLISHING"],On=s(({instanceStatus:e})=>!Gt.includes(e),"canInstanceStatusBeAccessed"),Mn=s(({instanceStatus:e})=>Re.includes(e),"canInstanceStatusEdit"),Fn=s(({instanceStatus:e})=>$t.includes(e),"canInstanceStatusPublish");var it=Wt(Ge());var Ye=Symbol.for("immer-nothing"),He=Symbol.for("immer-draftable"),C=Symbol.for("immer-state"),Jt=process.env.NODE_ENV!=="production"?[function(e){return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return `'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return `'original' expects a draft, got: ${e}`}]:[];function S(e,...t){if(process.env.NODE_ENV!=="production"){let n=Jt[e],a=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${a}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}s(S,"die");var W=Object.getPrototypeOf;function M(e){return !!e&&!!e[C]}s(M,"isDraft");function K(e){return e?Qe(e)||Array.isArray(e)||!!e[He]||!!e.constructor?.[He]||ce(e)||de(e):!1}s(K,"isDraftable");var Xt=Object.prototype.constructor.toString();function Qe(e){if(!e||typeof e!="object")return !1;let t=W(e);if(t===null)return !0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Xt}s(Qe,"isPlainObject");function se(e,t){ue(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e);}):e.forEach((n,a)=>t(a,n,e));}s(se,"each");function ue(e){let t=e[C];return t?t.type_:Array.isArray(e)?1:ce(e)?2:de(e)?3:0}s(ue,"getArchtype");function ve(e,t){return ue(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}s(ve,"has");function Ze(e,t,n){let a=ue(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n;}s(Ze,"set");function Yt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}s(Yt,"is");function ce(e){return e instanceof Map}s(ce,"isMap");function de(e){return e instanceof Set}s(de,"isSet");function z(e){return e.copy_||e.base_}s(z,"latest");function ke(e,t){if(ce(e))return new Map(e);if(de(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Qe(e);if(t===!0||t==="class_only"&&!n){let a=Object.getOwnPropertyDescriptors(e);delete a[C];let o=Reflect.ownKeys(a);for(let d=0;d<o.length;d++){let c=o[d],l=a[c];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(a[c]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[c]});}return Object.create(W(e),a)}else {let a=W(e);if(a!==null&&n)return {...e};let o=Object.create(a);return Object.assign(o,e)}}s(ke,"shallowCopy");function xe(e,t=!1){return pe(e)||M(e)||!K(e)||(ue(e)>1&&(e.set=e.add=e.clear=e.delete=Qt),Object.freeze(e),t&&Object.entries(e).forEach(([n,a])=>xe(a,!0))),e}s(xe,"freeze");function Qt(){S(2);}s(Qt,"dontMutateFrozenCollections");function pe(e){return Object.isFrozen(e)}s(pe,"isFrozen");var Zt={};function U(e){let t=Zt[e];return t||S(0,e),t}s(U,"getPlugin");var J;function et(){return J}s(et,"getCurrentScope");function er(e,t){return {drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}s(er,"createScope");function je(e,t){t&&(U("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t);}s(je,"usePatchesInScope");function _e(e){Ce(e),e.drafts_.forEach(tr),e.drafts_=null;}s(_e,"revokeScope");function Ce(e){e===J&&(J=e.parent_);}s(Ce,"leaveScope");function qe(e){return J=er(J,e)}s(qe,"enterScope");function tr(e){let t=e[C];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0;}s(tr,"revokeDraft");function Je(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[C].modified_&&(_e(t),S(4)),K(e)&&(e=oe(t,e),t.parent_||le(t,e)),t.patches_&&U("Patches").generateReplacementPatches_(n[C].base_,e,t.patches_,t.inversePatches_)):e=oe(t,n,[]),_e(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ye?e:void 0}s(Je,"processResult");function oe(e,t,n){if(pe(t))return t;let a=t[C];if(!a)return se(t,(o,d)=>Xe(e,a,t,o,d,n)),t;if(a.scope_!==e)return t;if(!a.modified_)return le(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let o=a.copy_,d=o,c=!1;a.type_===3&&(d=new Set(o),o.clear(),c=!0),se(d,(l,p)=>Xe(e,a,o,l,p,n,c)),le(e,o,!1),n&&e.patches_&&U("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_);}return a.copy_}s(oe,"finalize");function Xe(e,t,n,a,o,d,c){if(process.env.NODE_ENV!=="production"&&o===n&&S(5),M(o)){let l=d&&t&&t.type_!==3&&!ve(t.assigned_,a)?d.concat(a):void 0,p=oe(e,o,l);if(Ze(n,a,p),M(p))e.canAutoFreeze_=!1;else return}else c&&n.add(o);if(K(o)&&!pe(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;oe(e,o),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,a)&&le(e,o);}}s(Xe,"finalizeProperty");function le(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xe(t,n);}s(le,"maybeFreeze");function rr(e,t){let n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:et(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=a,d=Ee;n&&(o=[a],d=X);let{revoke:c,proxy:l}=Proxy.revocable(o,d);return a.draft_=l,a.revoke_=c,l}s(rr,"createProxyProxy");var Ee={get(e,t){if(t===C)return e;let n=z(e);if(!ve(n,t))return nr(e,n,t);let a=n[t];return e.finalized_||!K(a)?a:a===be(e.base_,t)?(Se(e),e.copy_[t]=we(a,e)):a},has(e,t){return t in z(e)},ownKeys(e){return Reflect.ownKeys(z(e))},set(e,t,n){let a=tt(z(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){let o=be(z(e),t),d=o?.[C];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Yt(n,o)&&(n!==void 0||ve(e.base_,t)))return !0;Se(e),Te(e);}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return be(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Se(e),Te(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=z(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){S(11);},getPrototypeOf(e){return W(e.base_)},setPrototypeOf(){S(12);}},X={};se(Ee,(e,t)=>{X[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};});X.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&S(13),X.set.call(this,e,t,void 0)};X.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&S(14),Ee.set.call(this,e[0],t,n,e[0])};function be(e,t){let n=e[C];return (n?z(n):e)[t]}s(be,"peek");function nr(e,t,n){let a=tt(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}s(nr,"readPropFromProto");function tt(e,t){if(!(t in e))return;let n=W(e);for(;n;){let a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=W(n);}}s(tt,"getDescriptorFromProto");function Te(e){e.modified_||(e.modified_=!0,e.parent_&&Te(e.parent_));}s(Te,"markChanged");function Se(e){e.copy_||(e.copy_=ke(e.base_,e.scope_.immer_.useStrictShallowCopy_));}s(Se,"prepareCopy");var ar=class{static{s(this,"Immer2");}constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){let d=n;n=t;let c=this;return s(function(p=d,...A){return c.produce(p,re=>n.call(this,re,...A))},"curriedProduce")}typeof n!="function"&&S(6),a!==void 0&&typeof a!="function"&&S(7);let o;if(K(t)){let d=qe(this),c=we(t,void 0),l=!0;try{o=n(c),l=!1;}finally{l?_e(d):Ce(d);}return je(d,a),Je(o,d)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Ye&&(o=void 0),this.autoFreeze_&&xe(o,!0),a){let d=[],c=[];U("Patches").generateReplacementPatches_(t,o,d,c),a(d,c);}return o}else S(1,t);},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return (c,...l)=>this.produceWithPatches(c,p=>t(p,...l));let a,o;return [this.produce(t,n,(c,l)=>{a=c,o=l;}),a,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy);}createDraft(e){K(e)||S(8),M(e)&&(e=ir(e));let t=qe(this),n=we(e,void 0);return n[C].isManual_=!0,Ce(t),n}finishDraft(e,t){let n=e&&e[C];(!n||!n.isManual_)&&S(9);let{scope_:a}=n;return je(a,t),Je(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e;}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e;}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let a=U("Patches").applyPatches_;return M(e)?a(e,t):this.produce(e,o=>a(o,t))}};function we(e,t){let n=ce(e)?U("MapSet").proxyMap_(e,t):de(e)?U("MapSet").proxySet_(e,t):rr(e,t);return (t?t.scope_:et()).drafts_.push(n),n}s(we,"createProxy");function ir(e){return M(e)||S(10,e),rt(e)}s(ir,"current");function rt(e){if(!K(e)||pe(e))return e;let t=e[C],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ke(e,t.scope_.immer_.useStrictShallowCopy_);}else n=ke(e,!0);return se(n,(a,o)=>{Ze(n,a,rt(o));}),t&&(t.finalized_=!1),n}s(rt,"currentImpl");var T=new ar;T.produceWithPatches.bind(T);T.setAutoFreeze.bind(T);T.setUseStrictShallowCopy.bind(T);T.applyPatches.bind(T);T.createDraft.bind(T);T.finishDraft.bind(T);var lr=Object.defineProperty,u=s((e,t)=>lr(e,"name",{value:t,configurable:!0}),"n");function st(e){if(typeof e!="string")return !1;try{return !!it.default.get(e)}catch{return !1}}s(st,"Ne");u(st,"isColor");var ge=r.define("ColorStringStruct",e=>typeof e=="string"&&st(e)),y=r.union([r.type({type:r.literal("value"),colorValue:ge}),r.type({type:r.literal("design-token"),tokenName:r.string()})]);r.type({type:r.literal("design-token"),tokenName:r.string()});var nt=r.object({unit:r.enums(["rem","px"]),value:r.number()}),at=r.union([r.string(),r.number()]),ur=(e=>(e.woff2="woff2",e.woff="woff",e))(ur||{}),cr=r.enums(["woff2","woff"]),dr=r.type({format:cr,type:r.literal("url"),path:r.string()}),ee=r.type({family:r.optional(r.string()),weight:r.optional(r.union([at,r.size(r.array(at),2)])),src:r.optional(r.array(dr)),style:r.optional(r.string()),display:r.optional(r.enums(["auto","block","swap","fallback","optional"])),variationSettings:r.optional(r.string()),unicodeRange:r.optional(r.string())}),pr=(e=>(e.inherit="As typed",e.capitalize="Capitalize",e.lowercase="Lowercase",e.uppercase="Uppercase",e))(pr||{}),fr=(e=>(e["ultra-condensed"]="Ultra-condensed",e["extra-condensed"]="Extra-condensed",e.condensed="Condensed",e["semi-condensed"]="Semi-condensed",e.normal="Normal",e["semi-expanded"]="Semi-expanded",e.expanded="Expanded",e["extra-expanded"]="Extra-expanded",e["ultra-expanded"]="Ultra-expanded",e))(fr||{}),te=r.type({fontWeight:r.optional(r.union([r.string(),r.number()])),textColor:r.optional(y),hoverColor:r.optional(y),underline:r.optional(r.boolean()),textTransform:r.optional(r.enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:r.optional(r.enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))}),gr=r.type({min:nt,max:r.optional(nt)}),f=r.type({fontSize:r.optional(gr),lineHeight:r.optional(r.union([r.string(),r.number()])),fontWeight:r.optional(r.union([r.string(),r.number()])),letterSpacing:r.optional(r.string()),fontFamily:r.optional(r.string()),textColor:r.optional(y),textTransform:r.optional(r.enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:r.optional(r.enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))});var H=r.union([f,r.type({accentColor:r.optional(y)})]),me=r.union([H,r.type({hoverColor:r.optional(y),backgroundColor:r.optional(y)})]),ye=r.union([H,r.type({backgroundColor:r.optional(y)})]);r.object({version:r.literal(1),oldSillySidebarBgColor:ge});r.object({version:r.literal(2),anotherSillySidebarBgColor:ge});r.object({version:r.literal(3),sidebarBgColor:ge});r.object({version:r.literal(4),primaryColor:y,darkColor:y,lightColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0))});r.object({version:r.literal(5),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0))});r.object({version:r.literal(6),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0)),appearance:r.type({customFonts:r.optional(r.array(ee)),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(7),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0)),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(me),secondaryNav:r.optional(ye),tabs:r.optional(H)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(8),primaryColor:y,darkColor:y,lightColor:y,linkColor:y,appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(me),secondaryNav:r.optional(ye),tabs:r.optional(H)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(9),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(me),secondaryNav:r.optional(ye),tabs:r.optional(H)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(10),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(me),secondaryNav:r.optional(ye),tabs:r.optional(H)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingXLarge:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),headingXSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});function ot(e){return typeof e!="string"?!1:e.split("{").length-1===1&&e.startsWith("{")&&e.endsWith("}")}s(ot,"He");u(ot,"isTokenReference");function P(e){return typeof e=="string"&&e.includes("{")}s(P,"x");u(P,"hasTokenReferences");function lt(e){return !ot(e)}s(lt,"Je");u(lt,"isNotTokenReference");var h=r__namespace.define("Token Reference",e=>typeof e!="string"?!1:lt(e)?"Must start and end with curly braces":!0),mr={border:"border",shadow:"shadow",transition:"transition"},yr=Object.values(mr),hr={string:"string",number:"number",boolean:"boolean",color:"color",dimension:"dimension",duration:"duration",fontWeight:"fontWeight",strokeStyle:"strokeStyle",cubicBezier:"cubicBezier"},br=Object.values(hr);function Ne(e){return yr.includes(e)}s(Ne,"J");u(Ne,"isTokenTypeComposite");function ut(e){return br.includes(e)}s(ut,"ye");u(ut,"isTokenTypeSingular");utils.expectType([{inset:!1,color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px"},{color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px",inset:!0}]);var b=r__namespace.type({id:r__namespace.string(),description:r__namespace.optional(r__namespace.string()),references:r__namespace.optional(r__namespace.array(r__namespace.array(r__namespace.string()))),tokenConfig:r__namespace.optional(r__namespace.type({purpose:r__namespace.optional(r__namespace.string())}))});utils.expectType([{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"static"},{type:"duration",value:"1ms",kind:"ref",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"ref"},{type:"duration",value:"1ms",kind:"static",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"color",value:"#000",kind:"static",id:"1",originalValue:"#000"},{type:"color",value:"#000",kind:"ref",id:"1",originalValue:"{c.b}",referencedTokenId:"c.b"},{type:"cubicBezier",kind:"static",value:[0,0,0,1],originalValue:[0,0,0,1],id:"1"}]);function Sr(e){return Ne(e.type)}s(Sr,"un");u(Sr,"isTokenDataComposite");utils.expectType([{type:"border",kind:"static",id:"1",value:{color:"#000",style:"solid",width:"1px"},originalValue:{color:"#000",style:"solid",width:"1px"}},{type:"border",kind:"ref",referencedTokenId:"a.b",id:"1",value:{color:"red",style:"dashed",width:"2px"},originalValue:"{a.b}"},{type:"shadow",value:{color:"#000",offsetX:"1px",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},originalValue:{color:"#000",offsetX:"{a.a}",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},id:"1",kind:"static"},{type:"shadow",kind:"ref",referencedTokenId:"a.b",value:{inset:!0,color:"red",offsetX:"1px",blur:"2px",offsetY:"3px",spread:"4px"},originalValue:"{a.b}",id:"1"},{type:"transition",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:"{a.b}",kind:"ref",referencedTokenId:"a.b",id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"{a.c}",timingFunction:"{a.c}"},id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},id:"1"}]);function ct(e){return typeof e=="string"&&!P(e)}s(ct,"et");u(ct,"isTokenValueColor");var $=r__namespace.define("Color Value",e=>typeof e!="string"?"Value must be a string":e===""?"Value must not be empty":P(e)?"Value must not contain {} (token references)":!0),vr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("color"),value:$,kind:r__namespace.literal("static"),originalValue:$}),b),kr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("color"),value:$,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Y(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("rem"))&&!P(e)}s(Y,"Y");u(Y,"isTokenValueDimension");var D=r__namespace.define("Dimension Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":!e.endsWith("px")&&!e.endsWith("rem")&&!e.endsWith("em")&&!e.endsWith("%")?"Value must end with px, rem, em or %":!0),_r=r__namespace.assign(r__namespace.type({type:r__namespace.literal("dimension"),value:D,kind:r__namespace.literal("static"),originalValue:D}),b),Cr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("dimension"),value:D,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Tr(e){return typeof e=="string"&&e.endsWith("ms")&&!P(e)}s(Tr,"gn");u(Tr,"isTokenValueDuration");var L=r__namespace.define("Duration Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":/^\d+ms$/.test(e)?!0:'Value must be a number followed by "ms" (e.g., "100ms")'),wr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("duration"),value:L,kind:r__namespace.literal("static"),originalValue:L}),b),xr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("duration"),value:L,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Er(e){return (typeof e=="string"||typeof e=="number")&&!P(e)}s(Er,"fn");u(Er,"isTokenValueFontWeight");var Ae=r__namespace.define("Font Weight Value",e=>typeof e!="string"&&typeof e!="number"?"Value must be a string or number":P(e)?"Value must not contain {} (token references)":!0),Ar=r__namespace.assign(r__namespace.type({type:r__namespace.literal("fontWeight"),value:Ae,kind:r__namespace.literal("static"),originalValue:Ae}),b),Dr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("fontWeight"),value:Ae,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Q=r__namespace.define("Cubic Bezier Value",e=>Array.isArray(e)?e.length!==4||!e.every(t=>typeof t=="number")?"Value must be an array of 4 numbers":e[0]<0||e[0]>1||e[2]<0||e[2]>1?"The first and third cubicBezier values must be between 0 and 1":!0:"Value must be an array"),Nr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("cubicBezier"),value:Q,kind:r__namespace.literal("static"),originalValue:Q}),b),Ir=r__namespace.assign(r__namespace.type({type:r__namespace.literal("cubicBezier"),value:Q,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function dt(e){return utils.isObject(e)&&ct(e.color)&&Y(e.offsetX)&&Y(e.offsetY)&&Y(e.blur)&&Y(e.spread)}s(dt,"ut");u(dt,"isTokenValueShadow");var pt=r__namespace.define("Shadow Value",e=>dt(e)?!0:`Expected a shadow value, got ${JSON.stringify(e)}`),Vr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("shadow"),value:pt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({color:r__namespace.union([$,h]),offsetX:r__namespace.union([D,h]),offsetY:r__namespace.union([D,h]),blur:r__namespace.union([D,h]),spread:r__namespace.union([D,h]),inset:r__namespace.union([r__namespace.optional(r__namespace.boolean()),h])})}),b),Pr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("shadow"),value:pt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),G=r__namespace.union([r__namespace.literal("solid"),r__namespace.literal("dashed"),r__namespace.literal("dotted"),r__namespace.literal("double"),r__namespace.literal("groove"),r__namespace.literal("ridge"),r__namespace.literal("outset"),r__namespace.literal("inset")]);function ft(e){return utils.isObject(e)&&$.is(e.color)&&G.is(e.style)&&D.is(e.width)}s(ft,"mt");u(ft,"isTokenValueBorder");var gt=r__namespace.define("Border Value",ft),Rr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("border"),value:gt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({color:r__namespace.union([$,h]),style:r__namespace.union([G,h]),width:r__namespace.union([D,h])})}),b),Or=r__namespace.assign(r__namespace.type({type:r__namespace.literal("border"),value:gt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function mt(e){return utils.isObject(e)&&Q.is(e.timingFunction)&&L.is(e.duration)&&L.is(e.delay)}s(mt,"kt");u(mt,"isTokenValueTransition");var yt=r__namespace.define("Transition Value",mt),Mr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("transition"),value:yt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({timingFunction:r__namespace.union([Q,h]),duration:r__namespace.union([L,h]),delay:r__namespace.union([L,h])})}),b),Fr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("transition"),value:yt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),zr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("string"),value:r__namespace.string(),kind:r__namespace.literal("static"),originalValue:r__namespace.string()}),b),Kr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("string"),value:r__namespace.string(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Ur=r__namespace.assign(r__namespace.type({type:r__namespace.literal("strokeStyle"),value:G,kind:r__namespace.literal("static"),originalValue:G}),b),Br=r__namespace.assign(r__namespace.type({type:r__namespace.literal("strokeStyle"),value:G,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:G}),b),Lr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("number"),value:r__namespace.number(),kind:r__namespace.literal("static"),originalValue:r__namespace.number()}),b),Wr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("number"),value:r__namespace.number(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),$r=r__namespace.assign(r__namespace.type({type:r__namespace.literal("boolean"),value:r__namespace.boolean(),kind:r__namespace.literal("static"),originalValue:r__namespace.boolean()}),b),Gr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("boolean"),value:r__namespace.boolean(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);u(e=>{if(!utils.isObject(e))throw new Error(`Expected token data to be an object, got ${JSON.stringify(e)}`);if(!utils.isObjKey("type",e))throw new Error(`Expected token data to have a "type" property, got ${JSON.stringify(e)}`);if(typeof e.type!="string")throw new Error(`Expected token data "type" property to be a string, got ${JSON.stringify(e)}`);let t=e.type,n=e.kind;try{switch(t){case"boolean":n==="ref"?Gr.assert(e):$r.assert(e);return;case"border":n==="ref"?Or.assert(e):Rr.assert(e);return;case"color":n==="ref"?kr.assert(e):vr.assert(e);return;case"cubicBezier":n==="ref"?Ir.assert(e):Nr.assert(e);return;case"dimension":n==="ref"?Cr.assert(e):_r.assert(e);return;case"duration":n==="ref"?xr.assert(e):wr.assert(e);return;case"fontWeight":n==="ref"?Dr.assert(e):Ar.assert(e);return;case"number":n==="ref"?Wr.assert(e):Lr.assert(e);return;case"shadow":n==="ref"?Pr.assert(e):Vr.assert(e);return;case"string":n==="ref"?Kr.assert(e):zr.assert(e);return;case"strokeStyle":n==="ref"?Br.assert(e):Ur.assert(e);return;case"transition":n==="ref"?Fr.assert(e):Mr.assert(e);return;default:throw new Error(`Unknown token data type: ${t}`)}}catch(a){throw a instanceof r__namespace.StructError?new Error(`Invalid token data for type "${t}": ${a.message}. Received this data: "${JSON.stringify(e)}"`):a}},"assertTokenData");utils.expectType([{type:"dimension",kind:"static",value:"1px"},{type:"dimension",kind:"ref",referencedTokenId:"a.b"}]);utils.expectType([{type:"border",kind:"ref",referencedTokenId:"a.b"},{type:"border",kind:"static",value:{color:{kind:"static",type:"color",value:"red"},style:{kind:"ref",type:"strokeStyle",referencedTokenId:""},width:{kind:"static",type:"dimension",value:"2px"}}}]);utils.expectType([{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function Hr(e){return ut(e?.type)}s(Hr,"Dn");u(Hr,"isTokenSrcValueInfoSingular");function jr(e){return Ne(e?.type)}s(jr,"hn");u(jr,"isTokenSrcValueInfoComposite");utils.expectType([{type:"dimension",kind:"static",value:"1px"},{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"ref",value:"1px"},{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function ht(e){return utils.isObject(e)&&utils.isObjKey("cloud.knapsack",e)}s(ht,"Rt");u(ht,"isTokenSrcExtensions");utils.expectType(["#ddd",!0,[83,1,1,1],{color:"#000",style:"solid",width:"1px"},{inset:!0,color:"#000",offsetX:"0px",offsetY:"{spacing.medium}",spread:"0px",blur:"0px"},{timingFunction:"{timing.ease}",duration:"{timing.duration.medium}",delay:"7ms",color:"#000"}]);function qr(e){return !!(utils.isObject(e)&&utils.isObjKey("$value",e))}s(qr,"Rn");u(qr,"isTokenSrc");function bt(e){return utils.isObject(e)&&!ht(e)&&!utils.isObjKey("$value",e)&&!utils.isObjKey("cloud.knapsack",e)}s(bt,"Bt");u(bt,"isTokenGroup");function Jr(e){if(bt(e)){let t=e.$extensions["cloud.knapsack"].group.collectionInfo;if(utils.isObjKey("type",t)&&utils.isObjKey("referenceId",t))return !0}return !1}s(Jr,"Bn");u(Jr,"isTokenTypeVarRef");function Xr(e){let t=typeof e;if(t==="string"||t==="number"||t==="boolean")return t;throw new Error(`Invalid token value type: ${JSON.stringify(t)}. Token value is: ${JSON.stringify(e)}`)}s(Xr,"An");u(Xr,"getPrimitiveValue");u(e=>e.includes("px")||e.includes("rem")||e.includes("em")||e.includes("%"),"isDimensionString");function Yr(e){let{value:t,unit:n}=utils.parseNumberWithUnit(e);if(!n)return {value:t};if(n!=="px"&&n!=="rem"&&n!=="em"&&n!=="%")throw new Error(`Invalid unit "${n}" for value: ${t}`);return {value:t,unit:n}}s(Yr,"Kn");u(Yr,"parseTokenDimensionValue");u(e=>utils.isObject(e)&&e.type==="text","isSlottedText");function Qr(e){return utils.isObject(e)&&e.type==="template-demo"}s(Qr,"jn");u(Qr,"isSlottedTemplateDemo");function Zr(e){return utils.isObject(e)&&e.type==="template-reference"}s(Zr,"Wn");u(Zr,"isSlottedTemplateReference");var en=(e=>(e.portrait="portrait",e.landscape="landscape",e))(en||{});function tn(e){return e?.type==="data"}s(tn,"Ln");u(tn,"isDataDemo");function rn(e){return e?.type==="template"}s(rn,"_n");u(rn,"isTemplateDemo");var nn=(e=>(e.auto="auto",e.small="small",e.medium="medium",e.large="large",e.full="full",e))(nn||{});function St(e){return !utils.isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","db"].every(t=>utils.isObjKey(t,e))?!1:!utils.isObjKey("metaState",e)}s(St,"At");u(St,"isKsAppClientDataNoMeta");r.define("KsAppClientDataNoMeta",St);function vt(e){return utils.isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","metaState","db"].every(t=>utils.isObjKey(t,e)):!1}s(vt,"Ot");u(vt,"isKsAppClientDataAndMeta");r.define("KsAppClientDataAndMeta",vt);r.type({isLocalDev:r.boolean(),plugins:r.array(r.type({id:r.string(),hasContent:r.boolean(),clientPluginPath:r.optional(r.string()),cssPath:r.optional(r.string())})),meta:r.optional(r.type({version:r.optional(r.string()),hasKnapsackCloud:r.boolean(),knapsackCloudSiteId:r.optional(r.string()),serverPort:r.optional(r.number()),websocketsPort:r.optional(r.number()),https:r.optional(r.boolean()),cacheDir:r.optional(r.string()),ksVersions:r.type({app:r.string()})}))});function kt(e){return !utils.isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState"].every(t=>utils.isObjKey(t,e))?!1:!utils.isObjKey("metaState",e)}s(kt,"Ut");u(kt,"isKsAppClientDataNoMetaV3");r.define("KsAppClientDataNoMeta",kt);function _t(e){return utils.isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState","metaState"].every(t=>utils.isObjKey(t,e)):!1}s(_t,"zt");u(_t,"isKsAppClientDataAndMetaV3");r.define("KsAppClientDataAndMeta",_t);r.type({isLocalDev:r.boolean(),plugins:r.array(r.type({id:r.string(),hasContent:r.boolean(),clientPluginPath:r.optional(r.string()),cssPath:r.optional(r.string())})),meta:r.optional(r.type({version:r.optional(r.string()),hasKnapsackCloud:r.boolean(),knapsackCloudSiteId:r.optional(r.string()),serverPort:r.optional(r.number()),websocketsPort:r.optional(r.number()),https:r.optional(r.boolean()),cacheDir:r.optional(r.string()),ksVersions:r.type({app:r.string()})}))});({version:"4.1.7",checkIfNeeded:u(e=>!0,"checkIfNeeded"),migrate:u(e=>{if(!M(e))throw new Error("Tried to run migrations on appClientData but it is not an Immer Draft");Object.values(e.patternsState.patterns).forEach(t=>{delete t.demoSize;}),Object.values(e.db.demos.byId).forEach(t=>{t.type==="data"&&(Object.entries(t.data.slots??{}).forEach(([n,a])=>{t.data.slots[n]=a.map(o=>typeof o=="string"?{type:"text",text:o}:(o.type==="template-reference"||o.type==="text"||(o.type="template-demo"),o));}),!(t.patternId&&t.templateId)&&(()=>{for(let{id:n,templates:a=[]}of Object.values(e.patternsState.patterns))for(let{id:o,demoIds:d=[]}of a)if(d.includes(t.id)){t.patternId=n,t.templateId=o;return}})());});},"migrate")});var on=(e=>(e.string="string",e.boolean="boolean",e.number="number",e.object="object",e.options="options",e.function="function",e.customTypeScript="customTypeScript",e.array="array",e.arrayOfObjects="arrayOfObjects",e.arrayOfStrings="arrayOfStrings",e.arrayOfNumbers="arrayOfNumbers",e.unknown="unknown",e))(on||{});u(e=>"type"in e&&e.type==="string"&&!("enum"in e),"isStringProp");u(e=>"type"in e&&e.type==="number","isNumberProp");u(e=>"type"in e&&e.type==="boolean","isBooleanProp");u(e=>"enum"in e,"isOptionsProp");u(e=>"typeof"in e&&e?.typeof==="function","isFunctionProp");u(e=>!("typeof"in e)&&"tsType"in e,"isCustomTypeScriptProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="object","isArrayOfObjectsProp");u(e=>"type"in e&&e.type==="object"&&"properties"in e&&Object.keys(e.properties).length>0,"isObjectProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="string","isArrayOfStringsProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="number","isArrayOfNumbersProp");var Ct=r__namespace.object({op:r__namespace.union([r__namespace.literal("replace"),r__namespace.literal("remove"),r__namespace.literal("add")]),path:r__namespace.array(r__namespace.union([r__namespace.string(),r__namespace.number()])),value:r__namespace.optional(r__namespace.any())}),ln=Ct;u(e=>ln.is(e),"isPatch");var De=r__namespace.array(Ct),un=De;u(e=>un.is(e),"isPatches");var Tt=r__namespace.type({patches:De,inversePatches:r__namespace.optional(De),event:r__namespace.optional(r__namespace.object({type:r__namespace.string()})),id:r__namespace.string(),date:r__namespace.string(),userId:r__namespace.optional(r__namespace.string())}),cn=Tt;u(e=>cn.is(e),"isKsRemoteChange");var dn=r__namespace.array(Tt),pn=dn;u(e=>pn.is(e),"isKsRemoteChanges");var fn=(e=>(e.ready="ready",e))(fn||{});var gn=(e=>(e.GitHub="GitHub",e.GitLab="GitLab",e.GitLabRest="GitLabRest",e.Bitbucket="Bitbucket",e.Azure="Azure",e))(gn||{}),mn=(e=>(e.Conflicting="CONFLICTING",e.Mergeable="MERGEABLE",e.Unknown="UNKNOWN",e))(mn||{}),yn=(e=>(e.Create="CREATE",e.Move="MOVE",e.Update="UPDATE",e.Chmod="CHMOD",e))(yn||{}),hn=(e=>(e.Base64="BASE64",e.Text="TEXT",e))(hn||{}),bn={ADMIN:"ADMIN",ANONYMOUS:"ANONYMOUS",CONTRIBUTOR:"CONTRIBUTOR",EDITOR:"EDITOR",MANAGER:"MANAGER",VIEWER:"VIEWER"},wt=Object.values(bn);var It=r.enums(wt),_n=It,Ja=s(e=>e==="ADMIN","canRoleAdmin"),Vt=["ADMIN","MANAGER"],Xa=s(e=>Vt.includes(e),"canRoleManageUsers"),Pt=[...Vt,"EDITOR"],Ya=s(e=>Pt.includes(e),"canRoleDelete"),Rt=[...Pt,"CONTRIBUTOR"],Qa=s(e=>Rt.includes(e),"canRoleEdit"),Cn=["ADMIN"],Za=s(e=>Cn.includes(e),"canRolePublish"),Tn=[...Rt,"VIEWER"],ei=s(e=>Tn.includes(e),"canRoleView"),wn=s(e=>_n.is(e),"isRoleValid"),Ot=(n=>(n.user="user",n.anonymous="anonymous",n))(Ot||{}),At=r.enums(Object.values(Ot)),xn=r.object({"x-hasura-allowed-roles":r.array(At),"x-hasura-default-role":At,"x-hasura-user-id":r.optional(r.string())}),En=r.object({userId:r.string(),isSuperAdmin:r.boolean(),sitesByRole:r.record(It,r.array(r.string()))}),An=r.type({exp:r.number(),email:r.optional(r.string()),email_verified:r.optional(r.union([r.string(),r.boolean()])),iat:r.number(),iss:r.string(),sub:r.string(),aud:r.union([r.string(),r.array(r.string())])}),Dn="https://hasura.io/jwt/claims",Mt="https://knapsack.cloud",Nn=r.object({[Dn]:xn,[Mt]:En}),In=r.assign(An,Nn);function Vn(e){return Object.entries(e).reduce((t,[n,a])=>(wn(n)&&a.forEach(o=>{t[o]=n;}),t),{})}s(Vn,"expandSitesByRole");var Pn={isSuperAdmin:!1,userId:"",siteRoleMap:{},getSiteRole:s(()=>"ANONYMOUS","getSiteRole")},ti=s(e=>{if(!In.is(e))return Pn;let{sitesByRole:t,...n}=e[Mt],a=Vn(t);return {...n,siteRoleMap:a,getSiteRole:s(o=>n.isSuperAdmin?"ADMIN":a[o]||"ANONYMOUS","getSiteRole")}},"getKsClaims");var ai="/site-deployed",ii="/github-auth";function oi({dbUrl:e,apiUrl:t}){let{origin:n}=new URL(e||"https://db.knapsack.cloud"),a=new URL("/v1/graphql",n).toString(),o=new URL(a);o.protocol="wss:";let{origin:d}=new URL(t||"https://api.knapsack.cloud"),c=new URL("/graphql",d).toString();return {dbOrigin:n,dbGqlEndpoint:a,dbGqlWsEndpoint:o.toString(),apiGqlEndpoint:c,apiOrigin:d}}s(oi,"getKsUrls");var ci={siteId:"X-KS-Site-ID",instanceId:"X-KS-Instance-Id",appClientVersion:"X-KS-App-Client-Version",requestId:"X-KS-Request-Id"};
|
2
|
+
exports.HASURA_CLAIMS_NAMESPACE=Dn;exports.HasuraClaimsStruct=xn;exports.HasuraRoles=Ot;exports.JwtBaseStruct=An;exports.JwtCustomClaimsStruct=Nn;exports.JwtWithCustomClaimsStruct=In;exports.KNAPSACK_CLAIMS_NAMESPACE=Mt;exports.KsClaimsStruct=En;exports.RolesEnums=It;exports.RolesEnumsStruct=_n;exports.canInstanceStatusBeAccessed=On;exports.canInstanceStatusEdit=Mn;exports.canInstanceStatusPublish=Fn;exports.canRoleAdmin=Ja;exports.canRoleDelete=Ya;exports.canRoleEdit=Qa;exports.canRoleManageUsers=Xa;exports.canRolePublish=Za;exports.canRoleView=ei;exports.defaultAnonymousKsClaims=Pn;exports.expandSitesByRole=Vn;exports.getKsClaims=ti;exports.getKsUrls=oi;exports.gitHubOauthInternalEndpoint=ii;exports.instanceStatusesThatCanEdit=Re;exports.instanceStatusesThatCanPublish=$t;exports.instanceStatusesThatCannotBeAccessed=Gt;exports.isRoleValid=wn;exports.ksHttpHeaders=ci;exports.rolesThatCanDelete=Pt;exports.rolesThatCanEdit=Rt;exports.rolesThatCanManageUsers=Vt;exports.rolesThatCanPublish=Cn;exports.rolesThatCanView=Tn;exports.siteDeployedWebhookEndpoint=ai;//# sourceMappingURL=index.js.map
|
3
3
|
//# sourceMappingURL=index.js.map
|