slice-machine-ui 2.19.2-alpha.jp-figma-to-prismic.7 → 2.19.2-alpha.jp-figma-to-slice-1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/{31Ud_23VczjR1uJs9oG2p → bwDsGgVrRudGF6BhMNf48}/_buildManifest.js +1 -1
  3. package/out/_next/static/chunks/34-28725deef8b874b1.js +1 -0
  4. package/out/_next/static/chunks/344-a67ed5f369a194ae.js +1 -0
  5. package/out/_next/static/chunks/429-1137c819c2bf6b66.js +3 -0
  6. package/out/_next/static/chunks/{444-d39213143f782fec.js → 444-c3ffb44477761d17.js} +1 -1
  7. package/out/_next/static/chunks/{489-2e83dd8ae83fd5ed.js → 489-ce3053e1d81ade83.js} +1 -1
  8. package/out/_next/static/chunks/658-8231c0b729e0124a.js +1 -0
  9. package/out/_next/static/chunks/907-bf4215e6fc238ea0.js +1 -0
  10. package/out/_next/static/chunks/pages/{_app-426bac9cf22a56de.js → _app-69a74b6aaca04e69.js} +1 -1
  11. package/out/_next/static/chunks/pages/{changes-b3f45dfeb5dc08f0.js → changes-7f24b37f5bf872ae.js} +1 -1
  12. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-02278526092bcf5c.js → [customTypeId]-1b47424a37b49dff.js} +1 -1
  13. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-4d99de1b52de7c9b.js → [pageTypeId]-385f933c203e8b16.js} +1 -1
  14. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-330e5d545d9f6269.js → [variation]-08cdeefc96106c0c.js} +1 -1
  15. package/out/_next/static/chunks/pages/{slices-d6873e0fb6a46bb8.js → slices-bedcb854fbdca8cd.js} +1 -1
  16. package/out/changelog.html +1 -1
  17. package/out/changes.html +1 -1
  18. package/out/custom-types/[customTypeId].html +1 -1
  19. package/out/custom-types.html +1 -1
  20. package/out/index.html +1 -1
  21. package/out/labs.html +1 -1
  22. package/out/page-types/[pageTypeId].html +1 -1
  23. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  24. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  25. package/out/slices.html +1 -1
  26. package/package.json +3 -3
  27. package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/CreateSliceFromImageModal.tsx +310 -535
  28. package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/SliceCard.tsx +14 -57
  29. package/src/icons/FigmaIcon.tsx +34 -88
  30. package/src/legacy/components/ScreenshotChangesModal/index.tsx +1 -1
  31. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +2 -1
  32. package/src/pages/slices.tsx +1 -0
  33. package/out/_next/static/chunks/20-169231cb23a752ff.js +0 -1
  34. package/out/_next/static/chunks/344-b64f09e670634ed1.js +0 -1
  35. package/out/_next/static/chunks/429-aab52070cad2884b.js +0 -3
  36. package/out/_next/static/chunks/593-97393b59cba3d429.js +0 -1
  37. package/out/_next/static/chunks/907-0f84907d31c989bf.js +0 -1
  38. /package/out/_next/static/{31Ud_23VczjR1uJs9oG2p → bwDsGgVrRudGF6BhMNf48}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[444],{95766:function(t,e){"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,i=s(t),u=i[0],f=i[1],a=new o((u+f)*3/4-f),l=0,c=f>0?u-4:u;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],a[l++]=e>>16&255,a[l++]=e>>8&255,a[l++]=255&e;return 2===f&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[l++]=255&e),1===f&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],u=0,f=n-o;u<f;u+=16383)i.push(function(t,e,n){for(var o,i=[],u=e;u<n;u+=3)i.push(r[(o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]))>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(t,u,u+16383>f?f:u+16383));return 1===o?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===o&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=i.length;u<f;++u)r[u]=i[u],n[i.charCodeAt(u)]=u;function s(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48834:function(t,e,r){"use strict";let n=r(95766),o=r(62333),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function u(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!f.isEncoding(e))throw TypeError("Unknown encoding: "+e);let r=0|y(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){let e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);let o=function(t){var e;if(f.isBuffer(t)){let e=0|h(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?u(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return a(t),u(t<0?0:0|h(t))}function c(t){let e=t.length<0?0:0|h(t.length),r=u(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),f.prototype),n}function h(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function y(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(o)return n?-1:_(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=j[t[n]];return o}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":var i,u;return i=e,u=r,0===i&&u===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(i,u));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}(this,e,r);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function g(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(i=r=+r)!=i&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return -1;r=t.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){let i,u=1,f=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;u=2,f/=2,s/=2,r/=2}function a(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){let n=-1;for(i=r;i<f;i++)if(a(t,i)===a(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===s)return n*u}else -1!==n&&(i-=i-n),n=-1}else for(r+s>f&&(r=f-s),i=r;i>=0;i--){let r=!0;for(let n=0;n<s;n++)if(a(t,i+n)!==a(e,n)){r=!1;break}if(r)return i}return -1}function b(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let e=t[o],i=null,u=e>239?4:e>223?3:e>191?2:1;if(o+u<=r){let r,n,f,s;switch(u){case 1:e<128&&(i=e);break;case 2:(192&(r=t[o+1]))==128&&(s=(31&e)<<6|63&r)>127&&(i=s);break;case 3:r=t[o+1],n=t[o+2],(192&r)==128&&(192&n)==128&&(s=(15&e)<<12|(63&r)<<6|63&n)>2047&&(s<55296||s>57343)&&(i=s);break;case 4:r=t[o+1],n=t[o+2],f=t[o+3],(192&r)==128&&(192&n)==128&&(192&f)==128&&(s=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&f)>65535&&s<1114112&&(i=s)}}null===i?(i=65533,u=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=u}return function(t){let e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,o,i){if(!f.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function B(t,e,r,n,o){P(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=u,u>>=8,t[r++]=u,u>>=8,t[r++]=u,u>>=8,t[r++]=u,r}function A(t,e,r,n,o){P(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=u,u>>=8,t[r+2]=u,u>>=8,t[r+1]=u,u>>=8,t[r]=u,r+8}function U(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function I(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}e.lW=f,e.h2=50,f.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return(a(t),t<=0)?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=f.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let e=t[r];if($(e,Uint8Array))o+e.length>n.length?(f.isBuffer(e)||(e=f.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else if(f.isBuffer(e))e.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=e.length}return n},f.byteLength=y,f.prototype._isBuffer=!0,f.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):d.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){let t="",r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(f.prototype[i]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,o){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let i=o-n,u=r-e,s=Math.min(i,u),a=this.slice(n,o),l=t.slice(e,r);for(let t=0;t<s;++t)if(a[t]!==l[t]){i=a[t],u=l[t];break}return i<u?-1:u<i?1:0},f.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){var o,i,u,f,s,a,l,c;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let h=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let o;r=Number(r)||0;let i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;let u=e.length;for(n>u/2&&(n=u/2),o=0;o<n;++o){let n=parseInt(e.substr(2*o,2),16);if(n!=n)break;t[r+o]=n}return o}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,M(_(t,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return u=e,f=r,M(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,u,f);case"base64":return s=e,a=r,M(k(t),this,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,c=r,M(function(t,e){let r,n;let o=[];for(let i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-l),this,l,c);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},f.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&L(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+16777216*this[++t],o=this[++t]+256*this[++t]+65536*this[++t]+16777216*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),f.prototype.readBigUInt64BE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&L(t,this.length-8);let n=16777216*e+65536*this[++t]+256*this[++t]+this[++t],o=16777216*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},f.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&L(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+16777216*this[++t])}),f.prototype.readBigInt64BE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&L(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(16777216*this[++t]+65536*this[++t]+256*this[++t]+r)}),f.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;E(this,t,e,r,n,0)}let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;E(this,t,e,r,n,0)}let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigUInt64LE=N(function(t,e=0){return B(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=N(function(t,e=0){return A(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);E(this,t,e,r,n-1,-n)}let o=0,i=1,u=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);E(this,t,e,r,n-1,-n)}let o=r-1,i=1,u=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigInt64LE=N(function(t,e=0){return B(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=N(function(t,e=0){return A(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},f.prototype.fill=function(t,e,r,n){let o;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{let i=f.isBuffer(t)?t:f.from(t,n),u=i.length;if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=i[o%u]}return this};let x={};function R(t,e,r){x[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function O(t){let e="",r=t.length,n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function P(t,e,r,n,o,i){if(t>r||t<e){let n;let o="bigint"==typeof e?"n":"";throw n=i>3?0===e||e===BigInt(0)?`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:`>= ${e}${o} and <= ${r}${o}`,new x.ERR_OUT_OF_RANGE("value",n,t)}C(o,"offset"),(void 0===n[o]||void 0===n[o+i])&&L(o,n.length-(i+1))}function C(t,e){if("number"!=typeof t)throw new x.ERR_INVALID_ARG_TYPE(e,"number",t)}function L(t,e,r){if(Math.floor(t)!==t)throw C(t,r),new x.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new x.ERR_BUFFER_OUT_OF_BOUNDS;throw new x.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}R("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),R("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?o=O(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=O(o)),o+="n"),n+=` It must be ${e}. Received ${o}`},RangeError);let S=/[^+/0-9A-Za-z-_]/g;function _(t,e){let r;e=e||1/0;let n=t.length,o=null,i=[];for(let u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319||u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function k(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let j=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function N(t){return"undefined"==typeof BigInt?F:t}function F(){throw Error("BigInt not supported")}},36887:function(t,e,r){"use strict";r.d(e,{nk:function(){return F}});var n=r(2784),o=r(13980),i=r.n(o),u=r(44005);function f(){return(f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}var c=["public_id"],p=["publicId"],h=["children"],y=["children","accessibility","placeholder"],d=u.Util.camelCase,g=u.Util.withCamelCaseKeys,m=u.Util.isEmpty,v=["accessibility","breakpoints","dataSrc","placeholder","publicId","signature","authToken"],b={flv:"x-flv","3gp":"3gpp",mov:"quicktime",mpg:"mpeg",avi:"x-msvideo",wmv:"x-ms-wmv",ogv:"ogg"},w={m4a:"mp4",wav:"vnd.wav",m3u:"x-mpegurl",mp3:"mpeg",ogv:"ogg",aif:"x-aiff",aifc:"x-aiff",aiff:"x-aiff"},E=[].concat(u.Transformation.PARAM_NAMES,v).map(u.Util.camelCase).reduce(function(t,e){return t[e]=!0,t},{}),B=function(t){var e=l(Object.entries(t).reduce(function(t,e){var r,n=e[0],o=e[1];return null==o?t:f({},t,((r={})[n]=o,r))},{}),c),r=u.Util.withSnakeCaseKeys(e);return u.Cloudinary.new(r)},A=function(t,e){var r=t.publicId,n=l(t,p);return B(n)[e+"Tag"](r,u.Util.withSnakeCaseKeys(n))},U=function(t,e){var r=u.Util.withSnakeCaseKeys(e),n=B(r);return n.cloudinary_update(t,r),n.responsive(r,!1)},I=function(t){var e=t.children,r=l(t,h),n={children:e,cloudinaryProps:{},nonCloudinaryProps:{},cloudinaryReactProps:{}};return Object.keys(r).forEach(function(t){var e=u.Util.camelCase(t),o=r[t];E[e]?void 0!==r[t]&&null!==r[t]&&(n.cloudinaryProps[e]=o):"includeOwnBody"===e?n.cloudinaryReactProps[e]=o:n.nonCloudinaryProps[t]=o}),n},T=function(t,e){return!!(n.isValidElement(t)&&t.type&&t.type.displayName===e)},x=function(){return[].slice.call(arguments).reduce(function(t,e){return Object.keys(e||{}).forEach(function(r){var n=e[r];null!=n&&(t[r]=n)}),t},{})},R=function(t){var e=null;return t&&(e=n.Children.toArray(t).find(function(t){return T(t,"CloudinaryPlaceholder")})),e},O=function t(e){var r=e?n.Children.toArray(e).filter(function(t){return T(t,"CloudinaryTransformation")}).map(function(e){var r=x(e.props,e.context),n=t(e.props.children);return n&&(r.transformation=n),r}):[];return r.length?r:null},P=function(t){var e,r,n=t.children,o=t.accessibility,i=t.placeholder,f=(e=g(l(t,y)),((void 0===(r=u.Transformation.methods)&&(r=[]),e)?r.reduce(function(t,r){return r in e&&(t[r]=e[r]),t},{}):e)||{}),s=O(n);m(s)||(f.transformation=s);var a={accessibility:o,placeholder:i};return Object.keys(a).filter(function(t){return a[t]}).forEach(function(t){f[t]=a[t]}),f},C=(0,n.createContext)(),L=u.Util.camelCase,S=function(t){function e(e,r){var o;return(o=t.call(this,e,r)||this).getContext=function(){return o.context||{}},o.onIntersect=function(){o.setState({isInView:!0})},o.getExtendedProps=function(t,e){return void 0===t&&(t=o.props),void 0===e&&(e=o.getContext()),x(e,t)},o.attachRef=function(t){var e=o.props.innerRef;o.element.current=t,e&&(e instanceof Function?e(t):e.current=t)},o.element=(0,n.createRef)(),o}return s(e,t),e.prototype.render=function(){return null},e}(n.PureComponent);S.defaultProps={innerRef:null,publicId:null},S.propTypes=f({},function(t){t=t||[];for(var e={},r=0;r<t.length;r++)e[d(t[r])]=i().any;return e}(u.Transformation.PARAM_NAMES.map(L)),{innerRef:i().any,publicId:i().string}),S.contextType=C;var _=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.render=function(){var t=I(f({},this.getContext(),this.props)),e=t.children,r=t.cloudinaryProps,o=t.nonCloudinaryProps,i=t.cloudinaryReactProps;return n.createElement(C.Provider,{value:r},i.includeOwnBody?e:n.createElement("div",o,e))},e}(S);_.propTypes=f({},S.propTypes,{includeOwnBody:i().bool}),_.defaultProps={includeOwnBody:!1};var k=["children","innerRef"],M="\nWarning: passing a number value for width cancels the 'responsive' prop's effect on the image transformation.\nThe 'responsive' prop affects the image transformation only when width === 'auto'.\nPassing 'width=\"auto\" responsive' will affect the actual image width that is fetched from Cloudinary.\nThe 'responsive' prop causes the Image component to request an image which width is equal to the width of it's container.\nWhen passing 'width=\"auto\" responsive', you can set the <img> element width by passing a 'style' prop".trim(),$=function(t){function e(e,r){var o;return(o=t.call(this,e,r)||this).isResponsive=function(){var t=o.getExtendedProps(),e=t.responsive,r=t.width;return e&&"auto"!==r&&console.warn(M),e&&o.element&&o.element.current},o.getOptions=function(){var t=o.getExtendedProps(),e=l(f({},t,P(t)),k);return o.shouldLazyLoad()||delete e.loading,e},o.getAttributes=function(t){void 0===t&&(t={});var e=t.placeholder,r=I(f({},o.getOptions(),t)),n=r.cloudinaryProps,i=r.nonCloudinaryProps,s=r.cloudinaryReactProps,a=A(f({},n,s),"image"),l=u.Util.withCamelCaseKeys(a.attributes()),c=f({},l,i);return c.dataSrc&&(c["data-src"]=c.dataSrc),e&&c.id&&(c.id+="-cld-placeholder"),o.shouldLazyLoad()&&(c["data-src"]=c.dataSrc||c.src,delete c.src),v.forEach(function(t){delete c[t]}),c},o.update=function(){if(o.shouldLazyLoad())u.Util.detectIntersection(o.element.current,o.onIntersect);else if(o.isResponsive()){var t=o.getOptions(),e=o.getPlaceholderType();if(e){var r=U(o.placeholderElement.current,f({},t,{placeholder:e}));o.listenerRemovers.push(r)}var n=U(o.element.current,t);o.listenerRemovers.push(n)}},o.shouldLazyLoad=function(){var t=o.getExtendedProps().loading;return!o.state.isInView&&("lazy"===t||"auto"===t)},o.handleImageLoaded=function(){var t=o.props.onLoad;o.setState({isLoaded:!0},function(){t&&t()})},o.renderPlaceholder=function(t,e){e.style=f({},e.style||{},{opacity:0,position:"absolute"}),e.onLoad=o.handleImageLoaded;var r=o.getAttributes({placeholder:t});return n.createElement(n.Fragment,null,o.renderImage(e),n.createElement("div",{style:{display:"inline"}},n.createElement("img",f({ref:o.placeholderElement},r))))},o.renderImage=function(t){return n.createElement("img",f({ref:o.attachRef},t))},o.getPlaceholderType=function(){var t=R(o.getExtendedProps().children);return t?t.props.type:null},o.placeholderElement=(0,n.createRef)(),o.state={isLoaded:!1},o.listenerRemovers=[],o}s(e,t);var r=e.prototype;return r.componentDidMount=function(){this.update()},r.componentDidUpdate=function(){this.update()},r.componentWillUnmount=function(){this.listenerRemovers.forEach(function(t){return t()})},r.render=function(){var t=this.state.isLoaded,e=this.getAttributes(),r=this.getPlaceholderType();return!t&&r?this.renderPlaceholder(r,e):this.renderImage(e)},e}(S);$.defaultProps={},$.propTypes=S.propTypes,$.propTypes.responsive=i().bool,$.propTypes.loading=i().string,$.propTypes.accessibility=i().string;var j=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.render=function(){return null},e}(S);j.propTypes=S.propTypes,j.defaultProps={},j.exposesProps=!0,j.displayName="CloudinaryTransformation";var N=["innerRef","publicId","fallback","children","sourceTypes","sourceTransformation","sources"],F=function(t){function e(){for(var e,r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))||this).mimeType="video",e.mimeSubTypes=b,e.getMergedProps=function(){return f({},e.getContext(),e.props)},e.generateVideoUrl=function(t,e,r,n,o){var i=u.Util.withSnakeCaseKeys(u.Util.defaults({},n,r,{resource_type:"video",format:o}));return t.url(e,i)},e.generateUsingSourceTypes=function(t,r,n,o,i){return i.map(function(i){return e.toSourceTag(t,r,n,o[i]||{},i,e.buildMimeType(i))})},e.generateUsingSources=function(t,r,n,o){return o.map(function(o){var i=o.transformations,u=o.type,f=o.codecs;return e.toSourceTag(t,r,n,void 0===i?{}:i,u,e.buildMimeType(u,f))})},e.toSourceTag=function(t,r,o,i,u,f){var s=e.generateVideoUrl(t,r,o,i,u);return n.createElement("source",{key:s+f,src:s,type:f})},e.buildMimeType=function(t,r){var n=e.mimeType+"/"+(e.mimeSubTypes[t]||t);return u.Util.isEmpty(r)||(n+="; codecs="+(u.Util.isArray(r)?r.join(", "):r)),n},e.getVideoTagProps=function(){var t=e.getMergedProps(),r=t.publicId,n=t.children,o=t.sourceTypes,i=t.sourceTransformation,s=void 0===i?{}:i,a=t.sources,c=l(t,N),p=I(c=x(c,{})),h=p.cloudinaryProps,y=p.cloudinaryReactProps,d=p.nonCloudinaryProps;c=f({},h,y);var g=u.Util.withSnakeCaseKeys(c),m=u.Cloudinary.new(g),v=m.videoTag(r,c).attributes();v=f({},u.Util.withCamelCaseKeys(v),d);var b=P(f({},c,{children:n})),w=null;return u.Util.isArray(a)&&!u.Util.isEmpty(a)?w=e.generateUsingSources(m,r,b,a):u.Util.isArray(o)?w=e.generateUsingSourceTypes(m,r,b,s,o):v.src=e.generateVideoUrl(m,r,b,s[o]||{},o),{sources:w,tagAttributes:v}},e.reloadVideo=function(){e.element&&e.element.current&&e.element.current.load()},e}s(e,t);var r=e.prototype;return r.componentDidUpdate=function(){this.reloadVideo()},r.render=function(){var t=this.props,e=t.fallback,r=t.children,o=this.getVideoTagProps(),i=o.tagAttributes,u=o.sources;return n.createElement("video",f({ref:this.attachRef},i),u,e,r)},e}(S);F.propTypes={publicId:i().string,sources:i().arrayOf(i().shape({type:i().string,codecs:i().oneOfType([i().string,i().arrayOf(i().string)]),transformations:i().object}))},F.defaultProps={sourceTypes:u.Cloudinary.DEFAULT_VIDEO_PARAMS.source_types};var V=function(t){function e(){for(var e,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).mimeType="audio",e.mimeSubTypes=w,e}return s(e,t),e.prototype.render=function(){var t=this.props,e=t.innerRef,r=t.fallback,o=t.children,i=this.getVideoTagProps(),u=i.tagAttributes,s=i.sources;return delete u.poster,n.createElement("audio",f({ref:e},u),s,r,o)},e}(F);V.propTypes={publicId:i().string},V.defaultProps={sourceTypes:["aac","mp3","ogg"]};var D=function(t){return null};D.propTypes={type:i().string},D.defaultProps={type:"blur"},D.displayName="CloudinaryPlaceholder"},62333:function(t,e){e.read=function(t,e,r,n,o){var i,u,f=8*o-n-1,s=(1<<f)-1,a=s>>1,l=-7,c=r?o-1:0,p=r?-1:1,h=t[e+c];for(c+=p,i=h&(1<<-l)-1,h>>=-l,l+=f;l>0;i=256*i+t[e+c],c+=p,l-=8);for(u=i&(1<<-l)-1,i>>=-l,l+=n;l>0;u=256*u+t[e+c],c+=p,l-=8);if(0===i)i=1-a;else{if(i===s)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,n),i-=a}return(h?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,f,s,a=8*i-o-1,l=(1<<a)-1,c=l>>1,p=23===o?5960464477539062e-23:0,h=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(f=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),u+c>=1?e+=p/s:e+=p*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=l?(f=0,u=l):u+c>=1?(f=(e*s-1)*Math.pow(2,o),u+=c):(f=e*Math.pow(2,c-1)*Math.pow(2,o),u=0));o>=8;t[r+h]=255&f,h+=y,f/=256,o-=8);for(u=u<<o|f,a+=o;a>0;t[r+h]=255&u,h+=y,u/=256,a-=8);t[r+h-y]|=128*d}},38333:function(t,e,r){var n=r(77832);t.exports=function(t,e){return!!(null==t?0:t.length)&&n(t,e,0)>-1}},34893:function(t){t.exports=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}},28582:function(t,e,r){var n=r(13940),o=r(41225);t.exports=function(t,e,r){(void 0===r||o(t[e],r))&&(void 0!==r||e in t)||n(t,e,r)}},85246:function(t,e,r){var n=r(45386),o=r(38333),i=r(34893),u=r(50343),f=r(47826),s=r(59950);t.exports=function(t,e,r,a){var l=-1,c=o,p=!0,h=t.length,y=[],d=e.length;if(!h)return y;r&&(e=u(e,f(r))),a?(c=i,p=!1):e.length>=200&&(c=s,p=!1,e=new n(e));t:for(;++l<h;){var g=t[l],m=null==r?g:r(g);if(g=a||0!==g?g:0,p&&m==m){for(var v=d;v--;)if(e[v]===m)continue t;y.push(g)}else c(e,m,a)||y.push(g)}return y}},21359:function(t){t.exports=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return -1}},23919:function(t,e,r){var n=r(67552),o=r(61049);t.exports=function(t,e){return n(e,function(e){return o(t[e])})}},77832:function(t,e,r){var n=r(21359),o=r(22195),i=r(66024);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},22195:function(t){t.exports=function(t){return t!=t}},84565:function(t,e,r){var n=r(86571),o=r(28582),i=r(15308),u=r(25561),f=r(29259),s=r(18582),a=r(52434);t.exports=function t(e,r,l,c,p){e!==r&&i(r,function(i,s){if(p||(p=new n),f(i))u(e,r,s,l,t,c,p);else{var h=c?c(a(e,s),i,s+"",e,r,p):void 0;void 0===h&&(h=i),o(e,s,h)}},s)}},25561:function(t,e,r){var n=r(28582),o=r(92175),i=r(6190),u=r(51522),f=r(78725),s=r(79631),a=r(86152),l=r(93746),c=r(73226),p=r(61049),h=r(29259),y=r(97030),d=r(77598),g=r(52434),m=r(63329);t.exports=function(t,e,r,v,b,w,E){var B=g(t,r),A=g(e,r),U=E.get(A);if(U){n(t,r,U);return}var I=w?w(B,A,r+"",t,e,E):void 0,T=void 0===I;if(T){var x=a(A),R=!x&&c(A),O=!x&&!R&&d(A);I=A,x||R||O?a(B)?I=B:l(B)?I=u(B):R?(T=!1,I=o(A,!0)):O?(T=!1,I=i(A,!0)):I=[]:y(A)||s(A)?(I=B,s(B)?I=m(B):(!h(B)||p(B))&&(I=f(A))):T=!1}T&&(E.set(A,I),b(I,A,v,w,E),E.delete(A)),n(t,r,I)}},36060:function(t,e,r){var n=r(23059),o=r(43114),i=r(75251);t.exports=function(t,e){return i(o(t,e,n),t+"")}},51704:function(t,e,r){var n=r(52153),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},50753:function(t,e,r){var n=r(50343);t.exports=function(t,e){return n(e,function(e){return t[e]})}},10768:function(t,e,r){var n=r(77832);t.exports=function(t,e){for(var r=t.length;r--&&n(e,t[r],0)>-1;);return r}},51821:function(t,e,r){var n=r(77832);t.exports=function(t,e){for(var r=-1,o=t.length;++r<o&&n(e,t[r],0)>-1;);return r}},97263:function(t,e,r){var n=r(36060),o=r(82406);t.exports=function(t){return n(function(e,r){var n=-1,i=r.length,u=i>1?r[i-1]:void 0,f=i>2?r[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,f&&o(r[0],r[1],f)&&(u=i<3?void 0:u,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,u)}return e})}},82406:function(t,e,r){var n=r(41225),o=r(67878),i=r(39045),u=r(29259);t.exports=function(t,e,r){if(!u(r))return!1;var f=typeof e;return("number"==f?!!(o(r)&&i(e,r.length)):"string"==f&&e in r)&&n(r[e],t)}},52434:function(t){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},66024:function(t){t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return -1}},52153:function(t){var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},60019:function(t,e,r){var n=r(60091),o=r(752),i=r(97263),u=r(67878),f=r(16001),s=r(90249),a=Object.prototype.hasOwnProperty,l=i(function(t,e){if(f(e)||u(e)){o(e,s(e),t);return}for(var r in e)a.call(e,r)&&n(t,r,e[r])});t.exports=l},9850:function(t,e,r){var n=r(18874);t.exports=function(t){return n(t,5)}},60417:function(t){t.exports=function(t){for(var e=-1,r=null==t?0:t.length,n=0,o=[];++e<r;){var i=t[e];i&&(o[n++]=i)}return o}},17335:function(t,e,r){var n=r(85246),o=r(62034),i=r(36060),u=r(93746),f=i(function(t,e){return u(t)?n(t,o(e,1,u,!0)):[]});t.exports=f},1910:function(t,e,r){var n=r(23919),o=r(90249);t.exports=function(t){return null==t?[]:n(t,o(t))}},11886:function(t,e,r){var n=r(77832),o=r(67878),i=r(85505),u=r(38101),f=r(98346),s=Math.max;t.exports=function(t,e,r,a){t=o(t)?t:f(t),r=r&&!a?u(r):0;var l=t.length;return r<0&&(r=s(l+r,0)),i(t)?r<=l&&t.indexOf(e,r)>-1:!!l&&n(t,e,r)>-1}},93746:function(t,e,r){var n=r(67878),o=r(15125);t.exports=function(t){return o(t)&&n(t)}},92301:function(t,e,r){var n=r(15125),o=r(97030);t.exports=function(t){return n(t)&&1===t.nodeType&&!o(t)}},98537:function(t,e,r){var n=r(84565),o=r(97263)(function(t,e,r){n(t,e,r)});t.exports=o},5707:function(t,e,r){var n=r(7642),o=1/0;t.exports=function(t){return t?(t=n(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},38101:function(t,e,r){var n=r(5707);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},7642:function(t,e,r){var n=r(51704),o=r(29259),i=r(4795),u=0/0,f=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=s.test(t);return r||a.test(t)?l(t.slice(2),r?2:8):f.test(t)?u:+t}},63329:function(t,e,r){var n=r(752),o=r(18582);t.exports=function(t){return n(t,o(t))}},5648:function(t,e,r){var n=r(1054),o=r(51704),i=r(23895),u=r(10768),f=r(51821),s=r(54996),a=r(66188);t.exports=function(t,e,r){if((t=a(t))&&(r||void 0===e))return o(t);if(!t||!(e=n(e)))return t;var l=s(t),c=s(e),p=f(l,c),h=u(l,c)+1;return i(l,p,h).join("")}},98346:function(t,e,r){var n=r(50753),o=r(90249);t.exports=function(t){return null==t?[]:n(t,o(t))}}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[444],{95766:function(t,e){"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,i=s(t),u=i[0],f=i[1],a=new o((u+f)*3/4-f),l=0,c=f>0?u-4:u;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],a[l++]=e>>16&255,a[l++]=e>>8&255,a[l++]=255&e;return 2===f&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[l++]=255&e),1===f&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],u=0,f=n-o;u<f;u+=16383)i.push(function(t,e,n){for(var o,i=[],u=e;u<n;u+=3)i.push(r[(o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]))>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(t,u,u+16383>f?f:u+16383));return 1===o?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===o&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=i.length;u<f;++u)r[u]=i[u],n[i.charCodeAt(u)]=u;function s(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48834:function(t,e,r){"use strict";let n=r(95766),o=r(62333),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function u(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!f.isEncoding(e))throw TypeError("Unknown encoding: "+e);let r=0|y(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){let e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);let o=function(t){var e;if(f.isBuffer(t)){let e=0|h(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?u(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return a(t),u(t<0?0:0|h(t))}function c(t){let e=t.length<0?0:0|h(t.length),r=u(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),f.prototype),n}function h(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function y(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(o)return n?-1:_(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=j[t[n]];return o}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":var i,u;return i=e,u=r,0===i&&u===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(i,u));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}(this,e,r);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function g(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(i=r=+r)!=i&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return -1;r=t.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){let i,u=1,f=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;u=2,f/=2,s/=2,r/=2}function a(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){let n=-1;for(i=r;i<f;i++)if(a(t,i)===a(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===s)return n*u}else -1!==n&&(i-=i-n),n=-1}else for(r+s>f&&(r=f-s),i=r;i>=0;i--){let r=!0;for(let n=0;n<s;n++)if(a(t,i+n)!==a(e,n)){r=!1;break}if(r)return i}return -1}function b(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let e=t[o],i=null,u=e>239?4:e>223?3:e>191?2:1;if(o+u<=r){let r,n,f,s;switch(u){case 1:e<128&&(i=e);break;case 2:(192&(r=t[o+1]))==128&&(s=(31&e)<<6|63&r)>127&&(i=s);break;case 3:r=t[o+1],n=t[o+2],(192&r)==128&&(192&n)==128&&(s=(15&e)<<12|(63&r)<<6|63&n)>2047&&(s<55296||s>57343)&&(i=s);break;case 4:r=t[o+1],n=t[o+2],f=t[o+3],(192&r)==128&&(192&n)==128&&(192&f)==128&&(s=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&f)>65535&&s<1114112&&(i=s)}}null===i?(i=65533,u=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=u}return function(t){let e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,o,i){if(!f.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function B(t,e,r,n,o){P(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=u,u>>=8,t[r++]=u,u>>=8,t[r++]=u,u>>=8,t[r++]=u,r}function A(t,e,r,n,o){P(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=u,u>>=8,t[r+2]=u,u>>=8,t[r+1]=u,u>>=8,t[r]=u,r+8}function U(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function I(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}e.lW=f,e.h2=50,f.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return(a(t),t<=0)?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=f.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let e=t[r];if($(e,Uint8Array))o+e.length>n.length?(f.isBuffer(e)||(e=f.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else if(f.isBuffer(e))e.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=e.length}return n},f.byteLength=y,f.prototype._isBuffer=!0,f.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):d.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){let t="",r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(f.prototype[i]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,o){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let i=o-n,u=r-e,s=Math.min(i,u),a=this.slice(n,o),l=t.slice(e,r);for(let t=0;t<s;++t)if(a[t]!==l[t]){i=a[t],u=l[t];break}return i<u?-1:u<i?1:0},f.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){var o,i,u,f,s,a,l,c;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let h=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let o;r=Number(r)||0;let i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;let u=e.length;for(n>u/2&&(n=u/2),o=0;o<n;++o){let n=parseInt(e.substr(2*o,2),16);if(n!=n)break;t[r+o]=n}return o}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,M(_(t,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return u=e,f=r,M(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,u,f);case"base64":return s=e,a=r,M(k(t),this,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,c=r,M(function(t,e){let r,n;let o=[];for(let i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-l),this,l,c);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},f.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&L(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+16777216*this[++t],o=this[++t]+256*this[++t]+65536*this[++t]+16777216*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),f.prototype.readBigUInt64BE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&L(t,this.length-8);let n=16777216*e+65536*this[++t]+256*this[++t]+this[++t],o=16777216*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},f.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&L(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+16777216*this[++t])}),f.prototype.readBigInt64BE=N(function(t){C(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&L(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(16777216*this[++t]+65536*this[++t]+256*this[++t]+r)}),f.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;E(this,t,e,r,n,0)}let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;E(this,t,e,r,n,0)}let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigUInt64LE=N(function(t,e=0){return B(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=N(function(t,e=0){return A(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);E(this,t,e,r,n-1,-n)}let o=0,i=1,u=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);E(this,t,e,r,n-1,-n)}let o=r-1,i=1,u=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigInt64LE=N(function(t,e=0){return B(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=N(function(t,e=0){return A(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},f.prototype.fill=function(t,e,r,n){let o;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{let i=f.isBuffer(t)?t:f.from(t,n),u=i.length;if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=i[o%u]}return this};let x={};function R(t,e,r){x[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function O(t){let e="",r=t.length,n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function P(t,e,r,n,o,i){if(t>r||t<e){let n;let o="bigint"==typeof e?"n":"";throw n=i>3?0===e||e===BigInt(0)?`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:`>= ${e}${o} and <= ${r}${o}`,new x.ERR_OUT_OF_RANGE("value",n,t)}C(o,"offset"),(void 0===n[o]||void 0===n[o+i])&&L(o,n.length-(i+1))}function C(t,e){if("number"!=typeof t)throw new x.ERR_INVALID_ARG_TYPE(e,"number",t)}function L(t,e,r){if(Math.floor(t)!==t)throw C(t,r),new x.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new x.ERR_BUFFER_OUT_OF_BOUNDS;throw new x.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}R("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),R("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?o=O(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=O(o)),o+="n"),n+=` It must be ${e}. Received ${o}`},RangeError);let S=/[^+/0-9A-Za-z-_]/g;function _(t,e){let r;e=e||1/0;let n=t.length,o=null,i=[];for(let u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319||u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function k(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let j=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function N(t){return"undefined"==typeof BigInt?F:t}function F(){throw Error("BigInt not supported")}},36887:function(t,e,r){"use strict";r.d(e,{nk:function(){return F}});var n=r(2784),o=r(13980),i=r.n(o),u=r(44005);function f(){return(f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}var c=["public_id"],p=["publicId"],h=["children"],y=["children","accessibility","placeholder"],d=u.Util.camelCase,g=u.Util.withCamelCaseKeys,m=u.Util.isEmpty,v=["accessibility","breakpoints","dataSrc","placeholder","publicId","signature","authToken"],b={flv:"x-flv","3gp":"3gpp",mov:"quicktime",mpg:"mpeg",avi:"x-msvideo",wmv:"x-ms-wmv",ogv:"ogg"},w={m4a:"mp4",wav:"vnd.wav",m3u:"x-mpegurl",mp3:"mpeg",ogv:"ogg",aif:"x-aiff",aifc:"x-aiff",aiff:"x-aiff"},E=[].concat(u.Transformation.PARAM_NAMES,v).map(u.Util.camelCase).reduce(function(t,e){return t[e]=!0,t},{}),B=function(t){var e=l(Object.entries(t).reduce(function(t,e){var r,n=e[0],o=e[1];return null==o?t:f({},t,((r={})[n]=o,r))},{}),c),r=u.Util.withSnakeCaseKeys(e);return u.Cloudinary.new(r)},A=function(t,e){var r=t.publicId,n=l(t,p);return B(n)[e+"Tag"](r,u.Util.withSnakeCaseKeys(n))},U=function(t,e){var r=u.Util.withSnakeCaseKeys(e),n=B(r);return n.cloudinary_update(t,r),n.responsive(r,!1)},I=function(t){var e=t.children,r=l(t,h),n={children:e,cloudinaryProps:{},nonCloudinaryProps:{},cloudinaryReactProps:{}};return Object.keys(r).forEach(function(t){var e=u.Util.camelCase(t),o=r[t];E[e]?void 0!==r[t]&&null!==r[t]&&(n.cloudinaryProps[e]=o):"includeOwnBody"===e?n.cloudinaryReactProps[e]=o:n.nonCloudinaryProps[t]=o}),n},T=function(t,e){return!!(n.isValidElement(t)&&t.type&&t.type.displayName===e)},x=function(){return[].slice.call(arguments).reduce(function(t,e){return Object.keys(e||{}).forEach(function(r){var n=e[r];null!=n&&(t[r]=n)}),t},{})},R=function(t){var e=null;return t&&(e=n.Children.toArray(t).find(function(t){return T(t,"CloudinaryPlaceholder")})),e},O=function t(e){var r=e?n.Children.toArray(e).filter(function(t){return T(t,"CloudinaryTransformation")}).map(function(e){var r=x(e.props,e.context),n=t(e.props.children);return n&&(r.transformation=n),r}):[];return r.length?r:null},P=function(t){var e,r,n=t.children,o=t.accessibility,i=t.placeholder,f=(e=g(l(t,y)),((void 0===(r=u.Transformation.methods)&&(r=[]),e)?r.reduce(function(t,r){return r in e&&(t[r]=e[r]),t},{}):e)||{}),s=O(n);m(s)||(f.transformation=s);var a={accessibility:o,placeholder:i};return Object.keys(a).filter(function(t){return a[t]}).forEach(function(t){f[t]=a[t]}),f},C=(0,n.createContext)(),L=u.Util.camelCase,S=function(t){function e(e,r){var o;return(o=t.call(this,e,r)||this).getContext=function(){return o.context||{}},o.onIntersect=function(){o.setState({isInView:!0})},o.getExtendedProps=function(t,e){return void 0===t&&(t=o.props),void 0===e&&(e=o.getContext()),x(e,t)},o.attachRef=function(t){var e=o.props.innerRef;o.element.current=t,e&&(e instanceof Function?e(t):e.current=t)},o.element=(0,n.createRef)(),o}return s(e,t),e.prototype.render=function(){return null},e}(n.PureComponent);S.defaultProps={innerRef:null,publicId:null},S.propTypes=f({},function(t){t=t||[];for(var e={},r=0;r<t.length;r++)e[d(t[r])]=i().any;return e}(u.Transformation.PARAM_NAMES.map(L)),{innerRef:i().any,publicId:i().string}),S.contextType=C;var _=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.render=function(){var t=I(f({},this.getContext(),this.props)),e=t.children,r=t.cloudinaryProps,o=t.nonCloudinaryProps,i=t.cloudinaryReactProps;return n.createElement(C.Provider,{value:r},i.includeOwnBody?e:n.createElement("div",o,e))},e}(S);_.propTypes=f({},S.propTypes,{includeOwnBody:i().bool}),_.defaultProps={includeOwnBody:!1};var k=["children","innerRef"],M="\nWarning: passing a number value for width cancels the 'responsive' prop's effect on the image transformation.\nThe 'responsive' prop affects the image transformation only when width === 'auto'.\nPassing 'width=\"auto\" responsive' will affect the actual image width that is fetched from Cloudinary.\nThe 'responsive' prop causes the Image component to request an image which width is equal to the width of it's container.\nWhen passing 'width=\"auto\" responsive', you can set the <img> element width by passing a 'style' prop".trim(),$=function(t){function e(e,r){var o;return(o=t.call(this,e,r)||this).isResponsive=function(){var t=o.getExtendedProps(),e=t.responsive,r=t.width;return e&&"auto"!==r&&console.warn(M),e&&o.element&&o.element.current},o.getOptions=function(){var t=o.getExtendedProps(),e=l(f({},t,P(t)),k);return o.shouldLazyLoad()||delete e.loading,e},o.getAttributes=function(t){void 0===t&&(t={});var e=t.placeholder,r=I(f({},o.getOptions(),t)),n=r.cloudinaryProps,i=r.nonCloudinaryProps,s=r.cloudinaryReactProps,a=A(f({},n,s),"image"),l=u.Util.withCamelCaseKeys(a.attributes()),c=f({},l,i);return c.dataSrc&&(c["data-src"]=c.dataSrc),e&&c.id&&(c.id+="-cld-placeholder"),o.shouldLazyLoad()&&(c["data-src"]=c.dataSrc||c.src,delete c.src),v.forEach(function(t){delete c[t]}),c},o.update=function(){if(o.shouldLazyLoad())u.Util.detectIntersection(o.element.current,o.onIntersect);else if(o.isResponsive()){var t=o.getOptions(),e=o.getPlaceholderType();if(e){var r=U(o.placeholderElement.current,f({},t,{placeholder:e}));o.listenerRemovers.push(r)}var n=U(o.element.current,t);o.listenerRemovers.push(n)}},o.shouldLazyLoad=function(){var t=o.getExtendedProps().loading;return!o.state.isInView&&("lazy"===t||"auto"===t)},o.handleImageLoaded=function(){var t=o.props.onLoad;o.setState({isLoaded:!0},function(){t&&t()})},o.renderPlaceholder=function(t,e){e.style=f({},e.style||{},{opacity:0,position:"absolute"}),e.onLoad=o.handleImageLoaded;var r=o.getAttributes({placeholder:t});return n.createElement(n.Fragment,null,o.renderImage(e),n.createElement("div",{style:{display:"inline"}},n.createElement("img",f({ref:o.placeholderElement},r))))},o.renderImage=function(t){return n.createElement("img",f({ref:o.attachRef},t))},o.getPlaceholderType=function(){var t=R(o.getExtendedProps().children);return t?t.props.type:null},o.placeholderElement=(0,n.createRef)(),o.state={isLoaded:!1},o.listenerRemovers=[],o}s(e,t);var r=e.prototype;return r.componentDidMount=function(){this.update()},r.componentDidUpdate=function(){this.update()},r.componentWillUnmount=function(){this.listenerRemovers.forEach(function(t){return t()})},r.render=function(){var t=this.state.isLoaded,e=this.getAttributes(),r=this.getPlaceholderType();return!t&&r?this.renderPlaceholder(r,e):this.renderImage(e)},e}(S);$.defaultProps={},$.propTypes=S.propTypes,$.propTypes.responsive=i().bool,$.propTypes.loading=i().string,$.propTypes.accessibility=i().string;var j=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.render=function(){return null},e}(S);j.propTypes=S.propTypes,j.defaultProps={},j.exposesProps=!0,j.displayName="CloudinaryTransformation";var N=["innerRef","publicId","fallback","children","sourceTypes","sourceTransformation","sources"],F=function(t){function e(){for(var e,r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))||this).mimeType="video",e.mimeSubTypes=b,e.getMergedProps=function(){return f({},e.getContext(),e.props)},e.generateVideoUrl=function(t,e,r,n,o){var i=u.Util.withSnakeCaseKeys(u.Util.defaults({},n,r,{resource_type:"video",format:o}));return t.url(e,i)},e.generateUsingSourceTypes=function(t,r,n,o,i){return i.map(function(i){return e.toSourceTag(t,r,n,o[i]||{},i,e.buildMimeType(i))})},e.generateUsingSources=function(t,r,n,o){return o.map(function(o){var i=o.transformations,u=o.type,f=o.codecs;return e.toSourceTag(t,r,n,void 0===i?{}:i,u,e.buildMimeType(u,f))})},e.toSourceTag=function(t,r,o,i,u,f){var s=e.generateVideoUrl(t,r,o,i,u);return n.createElement("source",{key:s+f,src:s,type:f})},e.buildMimeType=function(t,r){var n=e.mimeType+"/"+(e.mimeSubTypes[t]||t);return u.Util.isEmpty(r)||(n+="; codecs="+(u.Util.isArray(r)?r.join(", "):r)),n},e.getVideoTagProps=function(){var t=e.getMergedProps(),r=t.publicId,n=t.children,o=t.sourceTypes,i=t.sourceTransformation,s=void 0===i?{}:i,a=t.sources,c=l(t,N),p=I(c=x(c,{})),h=p.cloudinaryProps,y=p.cloudinaryReactProps,d=p.nonCloudinaryProps;c=f({},h,y);var g=u.Util.withSnakeCaseKeys(c),m=u.Cloudinary.new(g),v=m.videoTag(r,c).attributes();v=f({},u.Util.withCamelCaseKeys(v),d);var b=P(f({},c,{children:n})),w=null;return u.Util.isArray(a)&&!u.Util.isEmpty(a)?w=e.generateUsingSources(m,r,b,a):u.Util.isArray(o)?w=e.generateUsingSourceTypes(m,r,b,s,o):v.src=e.generateVideoUrl(m,r,b,s[o]||{},o),{sources:w,tagAttributes:v}},e.reloadVideo=function(){e.element&&e.element.current&&e.element.current.load()},e}s(e,t);var r=e.prototype;return r.componentDidUpdate=function(){this.reloadVideo()},r.render=function(){var t=this.props,e=t.fallback,r=t.children,o=this.getVideoTagProps(),i=o.tagAttributes,u=o.sources;return n.createElement("video",f({ref:this.attachRef},i),u,e,r)},e}(S);F.propTypes={publicId:i().string,sources:i().arrayOf(i().shape({type:i().string,codecs:i().oneOfType([i().string,i().arrayOf(i().string)]),transformations:i().object}))},F.defaultProps={sourceTypes:u.Cloudinary.DEFAULT_VIDEO_PARAMS.source_types};var V=function(t){function e(){for(var e,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).mimeType="audio",e.mimeSubTypes=w,e}return s(e,t),e.prototype.render=function(){var t=this.props,e=t.innerRef,r=t.fallback,o=t.children,i=this.getVideoTagProps(),u=i.tagAttributes,s=i.sources;return delete u.poster,n.createElement("audio",f({ref:e},u),s,r,o)},e}(F);V.propTypes={publicId:i().string},V.defaultProps={sourceTypes:["aac","mp3","ogg"]};var D=function(t){return null};D.propTypes={type:i().string},D.defaultProps={type:"blur"},D.displayName="CloudinaryPlaceholder"},62333:function(t,e){e.read=function(t,e,r,n,o){var i,u,f=8*o-n-1,s=(1<<f)-1,a=s>>1,l=-7,c=r?o-1:0,p=r?-1:1,h=t[e+c];for(c+=p,i=h&(1<<-l)-1,h>>=-l,l+=f;l>0;i=256*i+t[e+c],c+=p,l-=8);for(u=i&(1<<-l)-1,i>>=-l,l+=n;l>0;u=256*u+t[e+c],c+=p,l-=8);if(0===i)i=1-a;else{if(i===s)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,n),i-=a}return(h?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,f,s,a=8*i-o-1,l=(1<<a)-1,c=l>>1,p=23===o?5960464477539062e-23:0,h=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(f=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),u+c>=1?e+=p/s:e+=p*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=l?(f=0,u=l):u+c>=1?(f=(e*s-1)*Math.pow(2,o),u+=c):(f=e*Math.pow(2,c-1)*Math.pow(2,o),u=0));o>=8;t[r+h]=255&f,h+=y,f/=256,o-=8);for(u=u<<o|f,a+=o;a>0;t[r+h]=255&u,h+=y,u/=256,a-=8);t[r+h-y]|=128*d}},38333:function(t,e,r){var n=r(77832);t.exports=function(t,e){return!!(null==t?0:t.length)&&n(t,e,0)>-1}},34893:function(t){t.exports=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}},28582:function(t,e,r){var n=r(13940),o=r(41225);t.exports=function(t,e,r){(void 0===r||o(t[e],r))&&(void 0!==r||e in t)||n(t,e,r)}},85246:function(t,e,r){var n=r(45386),o=r(38333),i=r(34893),u=r(50343),f=r(47826),s=r(59950);t.exports=function(t,e,r,a){var l=-1,c=o,p=!0,h=t.length,y=[],d=e.length;if(!h)return y;r&&(e=u(e,f(r))),a?(c=i,p=!1):e.length>=200&&(c=s,p=!1,e=new n(e));t:for(;++l<h;){var g=t[l],m=null==r?g:r(g);if(g=a||0!==g?g:0,p&&m==m){for(var v=d;v--;)if(e[v]===m)continue t;y.push(g)}else c(e,m,a)||y.push(g)}return y}},21359:function(t){t.exports=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return -1}},23919:function(t,e,r){var n=r(67552),o=r(61049);t.exports=function(t,e){return n(e,function(e){return o(t[e])})}},77832:function(t,e,r){var n=r(21359),o=r(22195),i=r(66024);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},22195:function(t){t.exports=function(t){return t!=t}},84565:function(t,e,r){var n=r(86571),o=r(28582),i=r(15308),u=r(25561),f=r(29259),s=r(18582),a=r(52434);t.exports=function t(e,r,l,c,p){e!==r&&i(r,function(i,s){if(p||(p=new n),f(i))u(e,r,s,l,t,c,p);else{var h=c?c(a(e,s),i,s+"",e,r,p):void 0;void 0===h&&(h=i),o(e,s,h)}},s)}},25561:function(t,e,r){var n=r(28582),o=r(92175),i=r(6190),u=r(51522),f=r(78725),s=r(79631),a=r(86152),l=r(93746),c=r(73226),p=r(61049),h=r(29259),y=r(97030),d=r(77598),g=r(52434),m=r(63329);t.exports=function(t,e,r,v,b,w,E){var B=g(t,r),A=g(e,r),U=E.get(A);if(U){n(t,r,U);return}var I=w?w(B,A,r+"",t,e,E):void 0,T=void 0===I;if(T){var x=a(A),R=!x&&c(A),O=!x&&!R&&d(A);I=A,x||R||O?a(B)?I=B:l(B)?I=u(B):R?(T=!1,I=o(A,!0)):O?(T=!1,I=i(A,!0)):I=[]:y(A)||s(A)?(I=B,s(B)?I=m(B):(!h(B)||p(B))&&(I=f(A))):T=!1}T&&(E.set(A,I),b(I,A,v,w,E),E.delete(A)),n(t,r,I)}},36060:function(t,e,r){var n=r(23059),o=r(43114),i=r(75251);t.exports=function(t,e){return i(o(t,e,n),t+"")}},51704:function(t,e,r){var n=r(52153),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},50753:function(t,e,r){var n=r(50343);t.exports=function(t,e){return n(e,function(e){return t[e]})}},10768:function(t,e,r){var n=r(77832);t.exports=function(t,e){for(var r=t.length;r--&&n(e,t[r],0)>-1;);return r}},51821:function(t,e,r){var n=r(77832);t.exports=function(t,e){for(var r=-1,o=t.length;++r<o&&n(e,t[r],0)>-1;);return r}},97263:function(t,e,r){var n=r(36060),o=r(82406);t.exports=function(t){return n(function(e,r){var n=-1,i=r.length,u=i>1?r[i-1]:void 0,f=i>2?r[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,f&&o(r[0],r[1],f)&&(u=i<3?void 0:u,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,u)}return e})}},82406:function(t,e,r){var n=r(41225),o=r(67878),i=r(39045),u=r(29259);t.exports=function(t,e,r){if(!u(r))return!1;var f=typeof e;return("number"==f?!!(o(r)&&i(e,r.length)):"string"==f&&e in r)&&n(r[e],t)}},52434:function(t){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},66024:function(t){t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return -1}},52153:function(t){var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},60019:function(t,e,r){var n=r(60091),o=r(752),i=r(97263),u=r(67878),f=r(16001),s=r(90249),a=Object.prototype.hasOwnProperty,l=i(function(t,e){if(f(e)||u(e)){o(e,s(e),t);return}for(var r in e)a.call(e,r)&&n(t,r,e[r])});t.exports=l},9850:function(t,e,r){var n=r(18874);t.exports=function(t){return n(t,5)}},60417:function(t){t.exports=function(t){for(var e=-1,r=null==t?0:t.length,n=0,o=[];++e<r;){var i=t[e];i&&(o[n++]=i)}return o}},17335:function(t,e,r){var n=r(85246),o=r(62034),i=r(36060),u=r(93746),f=i(function(t,e){return u(t)?n(t,o(e,1,u,!0)):[]});t.exports=f},1910:function(t,e,r){var n=r(23919),o=r(90249);t.exports=function(t){return null==t?[]:n(t,o(t))}},11886:function(t,e,r){var n=r(77832),o=r(67878),i=r(85505),u=r(38101),f=r(98346),s=Math.max;t.exports=function(t,e,r,a){t=o(t)?t:f(t),r=r&&!a?u(r):0;var l=t.length;return r<0&&(r=s(l+r,0)),i(t)?r<=l&&t.indexOf(e,r)>-1:!!l&&n(t,e,r)>-1}},93746:function(t,e,r){var n=r(67878),o=r(15125);t.exports=function(t){return o(t)&&n(t)}},92301:function(t,e,r){var n=r(15125),o=r(97030);t.exports=function(t){return n(t)&&1===t.nodeType&&!o(t)}},98537:function(t,e,r){var n=r(84565),o=r(97263)(function(t,e,r){n(t,e,r)});t.exports=o},5707:function(t,e,r){var n=r(7642),o=1/0;t.exports=function(t){return t?(t=n(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},38101:function(t,e,r){var n=r(5707);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},7642:function(t,e,r){var n=r(51704),o=r(29259),i=r(4795),u=0/0,f=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=s.test(t);return r||a.test(t)?l(t.slice(2),r?2:8):f.test(t)?u:+t}},63329:function(t,e,r){var n=r(752),o=r(18582);t.exports=function(t){return n(t,o(t))}},5648:function(t,e,r){var n=r(1054),o=r(51704),i=r(23895),u=r(10768),f=r(51821),s=r(8435),a=r(66188);t.exports=function(t,e,r){if((t=a(t))&&(r||void 0===e))return o(t);if(!t||!(e=n(e)))return t;var l=s(t),c=s(e),p=f(l,c),h=u(l,c)+1;return i(l,p,h).join("")}},98346:function(t,e,r){var n=r(50753),o=r(90249);t.exports=function(t){return null==t?[]:n(t,o(t))}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[489],{19489:function(e,t,l){"use strict";l.d(t,{H:function(){return e4}});var n=l(52322),i=l(11699),a=l(97729),o=l.n(a),r=l(5632),s=l(2784),c=l(56580),d=l(43388),m=l(77630),u=l(23094),h=l(59294),p=l(58446),x=l(74217),v=l(94160),b=l(68968),y=l(23710),g=l(54597),f=l(98564);let j=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:l}=e,[i,a]=(0,s.useState)(l),o=(0,m.y6)(i),r=f.$[o],{actionQueueStatus:c,setNextAction:d}=(0,y.c)({errorMessage:r.autoSaveFailed}),{refreshState:u}=(0,g.Z)(),h=(0,x.R9)(u),{syncChanges:p}=(0,b.g)(),S=(0,s.useCallback)(e=>{let{customType:t,onSaveCallback:l,updateMeta:n}=e;a(t),d(async()=>{let{errors:e}=await (0,v.KA)({customType:t,updateMeta:n});if(e.length>0)throw e;h(await (0,v.y0)()),p(),null==l||l()})},[d,h,p]),I=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:i,setCustomType:S}),[c,i,S]);return(0,n.jsx)(j.Provider,{value:I,children:"function"==typeof t?t(I):t})}function I(){let e=(0,s.useContext)(j);if(!e)throw Error("CustomTypeProvider not found");return e}var C=l(30195);function T(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:o}=I(),[r,c]=null!==(e=(0,m.j5)(a))&&void 0!==e?e:[],d=c?(0,m.N3)(c):"",[u,h]=(0,s.useState)(null!=d?d:""),[p,v]=(0,s.useState)();(0,x.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let b=(0,s.useCallback)(()=>(0,n.jsx)(i.aX,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,n.jsxs)(i.ae,{open:t,onOpenChange:l,size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:b,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,n.jsx)(i.al,{title:"Edit the UID label"}),(0,n.jsx)(i.aj,{children:(0,n.jsxs)(i.aJ,{onSubmit:function(){p||(o({customType:c?(0,m.eK)(u,a):(0,m.H8)(u,a)}),l(!1))},children:[(0,n.jsx)(i.D,{flexDirection:"column",padding:16,gap:4,children:(0,n.jsx)(i.aM,{type:"text",label:"Label *",placeholder:"UID",value:u,onValueChange:function(e){h(e),v(function(e){let t=D.safeParse(e,{errorMap:w});if(t.error)return t.error.errors[0].message}(e))},error:p,description:"A label for the UID"})}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",disabled:!!p,children:"Save"})]})]})})]})}let D=C.z.string().max(35).min(1),w=e=>{switch(e.code){case C.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case C.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var k=l(94840),_=l(59532),L=l(63397),A=l(75289);let E=e=>{let{name:t,label:l,placeholder:i,error:a,...o}=e;return(0,n.jsxs)(A.xu,{mb:3,children:[(0,n.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,n.jsx)(L.gN,{name:t,type:"text",placeholder:i,as:A.II,autoComplete:"off",...o}),a?(0,n.jsx)(A.xv,{sx:{color:"error",mt:1},children:a}):null]})};var N=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a}=e;return(0,n.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,onSubmit:e=>{l(e),i()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,n.jsx)(E,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},M=e=>{let{isOpen:t,onSubmit:l,close:i}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,n.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,n.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),i()},children:"Yes, remove tab"})]})})},z=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a,initialTabKey:o}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{id:o},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:o,isValid:r}=e;return(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(E,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&o("id",e.target.value.trim())},onChange:e=>{o("id",e.target.value)}}),(0,n.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!r,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),i()},children:"Save"})]})}})},Z=l(28316),O=l(88932),P=l(35289),F=l(87446),K=l(45440),B=l(16086),R=l(358),U=l(5495),V=l(39302),X=l(3285),G=l(40141),Y=l(65077),q=l(91589),H=l(27213);let Q=e=>{let{openCreateSliceModal:t,openCreateSliceFromImageModal:l,openUpdateSliceZoneModal:a,openSlicesTemplatesModal:o,projectHasAvailableSlices:r,isSlicesTemplatesSupported:s}=e,c=(0,H.F)({menuType:"ActionList"});return(0,n.jsxs)(i.s,{"data-testid":"slice-zone-blank-slate",sx:{width:648},children:[(0,n.jsx)(i.x,{lineColor:"purple9",backgroundColor:"purple5",name:"add",size:"large"}),(0,n.jsx)(i.z,{size:"big",children:"Add slices"}),(0,n.jsx)(i.w,{children:"Slices are reusable website sections. You can use them on different pages and write unique content for each. Each slice has its own component in your code."}),(0,n.jsx)(i.v,{children:(0,n.jsxs)(i.A,{children:[(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromImage.BackgroundIcon,onClick:l,description:c.fromImage.description,children:c.fromImage.title}),(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromScratch.BackgroundIcon,onClick:t,description:c.fromScratch.description,children:c.fromScratch.title}),s&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromTemplate.BackgroundIcon,onClick:o,description:c.fromTemplate.description,children:c.fromTemplate.title}),r&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromExisting.BackgroundIcon,onClick:a,description:c.fromExisting.description,children:c.fromExisting.title})]})})]})};var W=l(98250);function $(e){let{customType:t,tabId:l,slices:n}=e,i={...t};return n.forEach(e=>{i={...i,tabs:i.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),i}var J=l(18566),ee=l(80148);async function et(){try{let{templates:e,errors:t}=await ee.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var el=l(6256),en=l(39204),ei=l(7723),ea=l(33986),eo=l(30527),er=l(55862);let es=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,n.jsx)(er.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,n.jsx)(eo.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:(0,n.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,n.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,n.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,n.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,n.jsx)(ea.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,n.jsx)(ea.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,n.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var ec=l(84879),ed=l(62434),em=l(63908),eu=l(63019),eh=l(65375),ep=l.n(eh);let ex=e=>{var t;let{isOpen:l,close:a,onSubmit:o,isLoading:r,slice:d,libraries:m}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e)})),h={from:null===(t=m[0])||void 0===t?void 0:t.name,sliceName:(0,R.MP)(d.key)},[p,v]=(0,s.useState)(h),[b,y]=(0,s.useState)();function g(e){v(e),y((0,eu.h)(e,m,u))}return(0,x.pQ)(l,()=>{l||(v(h),y(void 0))}),(0,n.jsxs)(i.ae,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Upgrade slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){b&&Object.keys(b).length>0||o({libraryID:p.from,sliceID:p.sliceName})},children:(0,n.jsxs)(i.D,{flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)(i.aM,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,R.MP)(d.key),")"),error:null==b?void 0:b.sliceName,value:p.sliceName,onValueChange:e=>g({...p,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)("label",{className:ep().label,children:(0,n.jsx)(i.bL,{variant:"bold",children:"Slice library *"})}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:p.from,onValueChange:e=>{e&&g({...p,from:e})},children:m.map(e=>(0,n.jsx)(i.bt,{value:e.name,children:e.name},e.name))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:r,disabled:b&&Object.keys(b).length>0,children:"Upgrade"})]})]})})})]})};var ev=l(96009),eb=l.n(ev);let ey=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,slice:d,sliceName:m,libraries:u,localSharedSlices:h}=e,p={libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:eb()(d.key),variationName:m},[v,b]=(0,s.useState)(!0),[y,g]=(0,s.useState)(p),[f,j]=(0,s.useState)({});function S(e){g(e),j(eg(e,u))}return(0,x.pQ)(a,()=>{a||(g(p),j({}))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Convert to slice variation"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){Object.keys(f).length>0||r(y)},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice *"}),"string"==typeof f.libraryID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:f.libraryID}):null,"string"==typeof f.sliceID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:f.sliceID}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(y.libraryID,"::").concat(y.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");S({...y,libraryID:t,sliceID:l})}},children:h.map(e=>(0,n.jsxs)(i.bt,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"Variation name *",placeholder:m,error:f.variationName,value:y.variationName,onValueChange:e=>{let t={...y,variationName:e.slice(0,30)};v&&(t.variationID=eb()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"ID *",placeholder:eb()(d.key),error:f.variationID,value:y.variationID,onValueChange:e=>{b(!1),S({...y,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:Object.keys(f).length>0,children:"Convert"})]})]})})})]})},eg=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let n=t.find(t=>t.path===e.libraryID);l.libraryID||n||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let i=null==n?void 0:n.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||i||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==i?void 0:i.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},ef=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,identicalSlices:d}=e,m=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[u,h]=(0,s.useState)(m),[p,v]=(0,s.useState)();return(0,x.pQ)(a,()=>{a||(h(m),v(void 0))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Merge with an existing slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){if(p)return;let[e,t,l]=u.split("::");r({libraryID:e,sliceID:t,variationID:l})},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice*"}),"string"==typeof p?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:p}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:u,onValueChange:function(e){h(e),e||v("Cannot be empty.")},children:d.map(e=>(0,n.jsx)(i.bt,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:!!p,children:"Merge"})]})]})})})]})},ej=e=>{var t;let{slice:l,path:a}=e,{refreshState:o}=(0,g.Z)(),[r,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(),{setCustomType:h}=I(),{libraries:p}=(0,c.v9)(e=>({libraries:(0,ei.Sd)(e)})),x="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,b=p.filter(e=>e.isLocal),y=b.map(e=>e.components).flat(),f=eS(l,x,y),j=async e=>{var t,n,i;if(!m)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:m});let{errors:r}=await ee.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(n=e.variationName)&&void 0!==n?n:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}});if(r.length)throw console.error("Could not convert slice `".concat(x,"`"),r),O.Am.error("Could not convert slice `".concat(x,"`")),r;let{model:s,errors:c}=await ee.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),O.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(o(await (0,v.y0)()),d(!1),u(void 0),m){case"as_new_slice":O.Am.success("".concat(x," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":O.Am.success("".concat(x," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:O.Am.success("".concat(x," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h({customType:s})},S={path:a,slice:l,sliceName:x,libraries:b,localSharedSlices:y,identicalSlices:f,close:()=>u(void 0),onSubmit:j,isLoading:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,n.jsxs)(i.as,{align:"start",children:[(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>u("as_new_slice"),children:"Upgrade slice"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>u("as_new_variation"),disabled:!y.length,children:"Convert to slice variation"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>u("merge_with_identical"),disabled:!f.length,children:"Merge with another slice"})]})]}),(0,n.jsx)(ex,{...S,isOpen:"as_new_slice"===m}),(0,n.jsx)(ey,{...S,isOpen:"as_new_variation"===m}),(0,n.jsx)(ef,{...S,isOpen:"merge_with_identical"===m})]})},eS=(e,t,l)=>(0,s.useMemo)(()=>{let n=[],i=(0,em.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,em.ux)(t,e.model.name);i.primary===l.primary&&i.items===l.items&&n.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return n},[e,t,l]),eI=e=>{let{slice:t,path:l}=e,[a]=(0,ec.E)("legacySliceUpgrader"),o=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,n.jsxs)(ed.Zb,{children:[(0,n.jsx)(ed.ZB,{component:"div",children:(0,n.jsx)(i.D,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(i.bL,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,n.jsxs)(ed.T$,{children:[(0,n.jsx)(i.c3,{content:o,side:"bottom",children:(0,n.jsx)(i.m,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,n.jsx)(ej,{slice:t,path:l}):null]}),(0,n.jsx)(ed.eW,{subtitle:"1 variation",title:(0,em.Dj)(t.value)})]})};var eC=l(51507),eT=l(21151);let eD=e=>{let{slices:t,format:l,path:i,onRemoveSharedSlice:a}=e,o=t.some(e=>"SharedSlice"!==e.type),r=f.$[l],[c]=(0,ec.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{o&&(c.enabled?O.Am.info("This ".concat(r.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):O.Am.warning("This ".concat(r.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[o]),(0,n.jsx)(eT.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,n.jsx)(eI,{slice:t,path:i})}{let t=e.payload;return(0,n.jsx)(eC.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,location:n,onSuccess:i}=e,{data:a,errors:o}=await ee.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(o.length>0||void 0===a)throw o;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],location:n,mode:"template",sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),O.Am.error(e)}}var ek=l(26109),e_=e=>{let{availableSlices:t,values:l}=e;return(0,n.jsx)(L.F2,{name:"sliceKeys",render:e=>(0,n.jsx)(eT.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{let i=l.sliceKeys.includes(t.model.id);return(0,n.jsx)(eC.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:n=>{n?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:i,slice:t,variant:"outlined"})}})})};let eL=e=>{let{formId:t,close:l,onSuccess:i,availableSlicesTemplates:a,localLibraries:o,location:r}=e,{createSliceSuccess:s}=(0,g.Z)();return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:o.map(e=>e.name),location:r,onSuccess:async e=>{s((await (0,v.y0)()).libraries),i(await Promise.all(e.map(async e=>(await ee.managerClient.slices.readSlice({libraryID:o[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:ek.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})}))})}})};var eA=e=>{let{formId:t,close:l,onSubmit:i,availableSlices:a}=e;return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;i(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a})}})};let eE=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:n,notFound:i}=e.value.reduce((e,t)=>{let{key:n,value:i}=t;if("SharedSlice"===i.type){let t=l.find(e=>e.model.id===n);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:n}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:n,value:i}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:n,notFound:i}};var eN=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:o,onRemoveSharedSlice:r,sliceZone:d,tabId:m}=e,u=(0,J.QT)(et,[]),[h,p]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),[y,f]=(0,s.useState)(!1),[j,S]=(0,s.useState)(!1),{remoteSlices:C,libraries:T}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e),libraries:(0,ei.Sd)(e),slices:(0,ei.xC)(e)})),{setCustomType:D}=I(),{completeStep:w}=(0,W.k)(),{openLoginModal:_}=(0,g.Z)(),L=(0,H.F)({menuType:"Dropdown"}),A=T.filter(e=>e.isLocal),{availableSlices:E,slicesInSliceZone:N,notFound:M}=(0,s.useMemo)(()=>d?eE(d,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,T]),[z,Z]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==M?void 0:M.length)&&M.forEach(e=>{let{key:t}=e;r(t)})},[M]);let F=N.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),K=E.filter(e=>!F.some(t=>t.model.id===e.model.id)),B=()=>{b(!0)},R=()=>{f(!0)},U=async()=>{await ee.managerClient.user.checkIsLoggedIn()?S(!0):_()},V=()=>{p(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},X=()=>{b(!1)},G=()=>{f(!1)},ea=()=>{p(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.Bu,{actions:d?(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,n.jsxs)(i.as,{align:"end",children:[(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromImage.BackgroundIcon,onSelect:()=>void U(),description:L.fromImage.description,children:L.fromImage.title}),(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromScratch.BackgroundIcon,onSelect:R,description:L.fromScratch.description,children:L.fromScratch.title}),u.length>0?(0,n.jsx)(i.at,{onSelect:V,renderStartIcon:()=>L.fromTemplate.BackgroundIcon,description:L.fromTemplate.description,children:L.fromTemplate.title}):void 0,K.length>0?(0,n.jsx)(i.at,{onSelect:B,renderStartIcon:()=>L.fromExisting.BackgroundIcon,description:L.fromExisting.description,children:L.fromExisting.title}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==m?(0,n.jsx)(i.bC,{checked:!!d,onCheckedChange:e=>{e?a():Z(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?N.length>0?(0,n.jsx)(Y.xR,{children:(0,n.jsx)(eD,{slices:N,format:l.format,path:{customTypeID:l.id,tabID:m,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:r})}):(0,n.jsx)(i.D,{flexDirection:"column",flexGrow:1,justifyContent:"center",alignItems:"center",padding:{block:32},children:(0,n.jsx)(Q,{openUpdateSliceZoneModal:B,openCreateSliceModal:R,openCreateSliceFromImageModal:()=>void U(),openSlicesTemplatesModal:V,projectHasAvailableSlices:K.length>0,isSlicesTemplatesSupported:u.length>0})}):void 0,x&&(0,n.jsx)(eA,{formId:"tab-slicezone-form-".concat(m),availableSlices:K,onSubmit:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success("Slice(s) added to slice zone")}}),w("createSlice"),X()},close:X}),h&&(0,n.jsx)(eL,{formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:u,localLibraries:A,location:"".concat(l.format,"_type"),onSuccess:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),w("createSlice"),ea()},close:ea}),z&&(0,n.jsx)(es,{closeDeleteSliceZoneModal:()=>{Z(!1)},deleteSliceZone:()=>{o(),Z(!1)}}),(null==A?void 0:A.length)!==0&&y&&(0,n.jsx)(el.c,{onSuccess:e=>{let t=$({customType:l,tabId:m,slices:[e]});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),G()},localLibraries:A,location:"".concat(l.format,"_type"),remoteSlices:C,onClose:G}),(0,n.jsx)(q.S,{open:j,location:"".concat(l.format,"_type"),onSuccess:e=>{let{slices:t,library:i}=e,a=$({customType:l,tabId:m,slices:t});D({customType:k.Dc.fromSM(a),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice(s) added to slice zone and created at: ",path:i}))}})},onClose:()=>{S(!1)}})]})};let eM=[K.C.UID,K.C.Image,K.C.Text,K.C.StructuredText,K.C.Link,K.C.Select,K.C.Boolean,K.C.Number,K.C.Color,K.C.Date,K.C.Table,K.C.Embed,K.C.Timestamp,K.C.GeoPoint,K.C.ContentRelationship,K.C.LinkToMedia,K.C.Group,K.C.NestedGroup];var ez=e=>{var t,l,a,o;let{tabId:r}=e,{customType:c,setCustomType:d}=I(),u=k.Dc.toSM(c),h=null===(t=u.tabs.find(e=>e.key===r))||void 0===t?void 0:t.sliceZone,p=null!==(a=null===(l=u.tabs.find(e=>e.key===r))||void 0===l?void 0:l.value)&&void 0!==a?a:[],x="page"===u.format&&u.repeatable?p.filter(e=>"uid"!==e.key):p,v=u.tabs.reduce((e,t)=>[...e,...t.value],[]),b=e=>{var t;let{apiId:l,value:n}=e,i=null===(t=n.config)||void 0===t?void 0:t.label;if((0,B.Ss)(K.C,n.type)||null==i)return;if("Range"===n.type||"IntegrationFields"===n.type||"Separator"===n.type)throw Error("Unsupported Field Type: ".concat(n.type));let a=K.C[n.type];try{a.schema.validateSync(n,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(n.type,'".'))}let o=k.L$.fromSM(n);d({customType:(0,m.xS)({customType:c,newField:o,newFieldId:l,sectionId:r}),onSaveCallback:()=>{O.Am.success("".concat("Group"===n.type?"Group":"Field"," added"))}}),(0,U.V)({id:l,field:o})},y=e=>{let{apiId:t,newKey:l,value:n,inGroupFieldAction:i,updateMeta:a}=e;if((0,B.Ss)(K.C,n.type))return;let o=k.L$.fromSM(n);d({customType:(0,m.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:o,sectionId:r}),onSaveCallback:()=>{"add"===i&&O.Am.success("Field added")},updateMeta:a}),i||(0,V.Z)({previousId:t,id:l,field:o})};return(0,n.jsx)(F.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.D,{padding:32,children:(0,n.jsx)(i.bg,{})}),children:(0,n.jsxs)(P.aV,{border:!1,style:{flexGrow:1},children:[(0,n.jsx)(G.Z,{zoneType:"customType",zoneTypeFormat:null!==(o=c.format)&&void 0!==o?o:"custom",tabId:r,title:"Static zone",dataTip:"",fields:x,poolOfFieldsToCheck:v,showHints:!0,EditModal:X.Z,widgetsArray:eM,onDeleteItem:e=>{d({customType:(0,m.AK)({customType:c,fieldId:e,sectionId:r})})},onSave:e=>""===e.apiId?b({...e,apiId:e.newKey}):y(e),onDragEnd:e=>{if((0,B.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let n=(0,m.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:r});(0,Z.flushSync)(()=>d({customType:n}))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,R.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,R.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,n.jsx)(eN,{customType:u,tabId:r,sliceZone:h,onRemoveSharedSlice:e=>{d({customType:(0,m.EN)({customType:c,sectionId:r,sliceId:e})})},onCreateSliceZone:()=>{d({customType:(0,m.Tr)(c,r)})},onDeleteSliceZone:()=>{d({customType:(0,m.E3)(c,r)})}})]})})})};let eZ=()=>{var e,t,l;let{customType:a,setCustomType:o}=I(),r=k.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=r.tabs[0])||void 0===e?void 0:e.key),[u,h]=(0,s.useState)(),p=(null===(l=r.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.c9,{sx:p?{flexGrow:1}:void 0,children:["page"===a.format?(0,n.jsx)(i.ca,{title:a.repeatable?(0,n.jsx)(T,{}):void 0}):void 0,(0,n.jsxs)(i.cb,{onValueChange:d,value:c,children:[(0,n.jsx)(i.cd,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:r.tabs.map(e=>(0,n.jsx)(i.ce,{menu:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.at,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"edit"}),children:"Rename"}),(0,n.jsx)(i.at,{color:"tomato",disabled:function(e){if(r.tabs.length<=1)return!0;let t=r.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),r.tabs.map(e=>(0,n.jsx)(i.cc,{value:e.key,children:(0,n.jsx)(ez,{tabId:e.key})},e.key))]})]}),(null==u?void 0:u.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(N,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.vB)(a,t)}),d(t)},tabIds:r.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(z,{close:()=>{h(void 0)},initialTabKey:u.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.HO)(a,u.tabKey,t)}),c===u.tabKey&&d(t)},tabIds:r.tabs.filter(e=>e.key!==u.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,n.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(o({customType:(0,m.F$)(a,u.tabKey)}),c===u.tabKey){var e;let t=null===(e=r.tabs.find(e=>e.key!==u.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eO=l(16442),eP=l(78254),eF=l(60867),eK=l(11166),eB=l(34919),eR=l.n(eB);let eU=e=>{let{tabs:t,...l}=e;return(0,n.jsxs)(eK.fC,{...l,className:eR().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,n.jsx)(eK.aV,{className:eR().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,n.jsx)(eK.xz,{className:eR().trigger,value:l,children:(0,n.jsx)(i.bL,{className:eR().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,n.jsx)(eK.VY,{className:eR().content,value:l,children:(0,n.jsx)(i.bn,{className:eR().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eV=l(25661),eX=l(88241),eG=l(32554),eY=l(44621),eq=l.n(eY);let eH=e=>{var t,l;let{inline:a,...o}=e,r=(0,eG.p)();if(!0===a)return(0,n.jsx)("code",{...o,className:eq().inlineCode});let s=(()=>{var e,t,l,n,i;if((null===(t=o.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(n=o.node)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(i=o.className)||void 0===i?void 0:i.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=o.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,n.jsx)(i.W,{...o,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:r})},language:c,code:String(o.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},eQ=e=>{let{markdown:t}=e;return(0,n.jsx)(eV.D,{children:t,linkTarget:"_blank",remarkPlugins:[eX.Z],components:{code:e=>(0,n.jsx)(eH,{...e}),h1:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"pre",variant:"normal"})}})};async function eW(e){let t=JSON.parse(e),{errors:l,documentation:n}=await ee.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return n}var e$=l(65480),eJ=l.n(e$);let e0=e=>{var t;let{model:l}=e,a=(0,eG.p)(),o=(t={kind:"PageSnippet",data:{model:l}},(0,J.QT)(eW,[JSON.stringify(t)])),{completeStep:r}=(0,W.k)();return 0===o.length?null:(0,n.jsxs)(i.ae,{size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",onClick:()=>{r("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,n.jsx)(i.al,{icon:"code",title:"Page snippet"}),(0,n.jsx)("section",{className:eJ().content,children:o.length>1?(0,n.jsx)(eU,{style:{flex:1},tabs:o.map((e,t)=>{let{label:l,content:i}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,n.jsx)(eQ,{markdown:i})}})}):(0,n.jsx)(i.bn,{style:{flex:1,padding:16},children:(0,n.jsx)(eQ,{markdown:o[0].content})})})]})},e1=e=>{let{model:t}=e;return(0,n.jsx)("div",{children:(0,n.jsx)(F.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.E,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,n.jsx)(e0,{model:t})})})})},e4=()=>{let e=(0,r.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eP.Jk)(t,(0,h.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eO.TG)(t)||e.replace("/")},[t,e]),t&&(0,eO.TG)(t))?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,n.jsx)(e6,{customType:t.local})]}):(0,n.jsx)(p.LN,{})},e6=e=>{let{customType:t}=e;return null===t?(0,n.jsx)(p.LN,{}):(0,n.jsx)(p.LN,{children:(0,n.jsx)(S,{initialCustomType:k.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:o,setCustomType:r}=e,s=(0,m.y6)(o),c=h.cd[t.format],x=f.$[t.format];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(p.wd,{children:[(0,n.jsx)(p.Xq,{url:c.tablePagePathname}),(0,n.jsxs)(p.Cx,{children:[(0,n.jsx)(d.g,{children:x.name({start:!0,plural:!0})}),(0,n.jsx)(d.g,{active:!0,children:null!==(l=o.label)&&void 0!==l?l:o.id})]}),(0,n.jsxs)(p.K2,{children:[(0,n.jsx)(u.X,{status:a}),"page"===o.format?(0,n.jsx)(e1,{model:o}):void 0,(0,n.jsx)(eF._,{isChangesLocal:!0,format:s,customType:o,setLocalCustomType:r})]})]}),(0,n.jsx)(p.RN,{children:(0,n.jsx)(i.D,{flexDirection:"column",minWidth:0,children:(0,n.jsx)(eZ,{})})})]})}})})}},84879:function(e,t,l){"use strict";l.d(t,{E:function(){return o}});var n=l(18566),i=l(80148);async function a(){return i.managerClient.project.getSliceMachineConfig()}function o(e){var t,l;let[o,r]=[(0,n.QT)(a,[]),async e=>{await i.managerClient.project.writeSliceMachineConfig({config:e}),(0,n.VA)(a,[],e)}],s=async t=>{let l={...o,labs:{...o.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await r(l)};return[{enabled:null!==(l=null==o?void 0:null===(t=o.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},s]}},34919:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},65480:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},44621:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},65375:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[489],{19489:function(e,t,l){"use strict";l.d(t,{H:function(){return e4}});var n=l(52322),i=l(11699),a=l(97729),o=l.n(a),r=l(5632),s=l(2784),c=l(56580),d=l(43388),m=l(77630),u=l(23094),h=l(59294),p=l(58446),x=l(74217),v=l(94160),b=l(68968),y=l(23710),g=l(54597),f=l(98564);let j=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:l}=e,[i,a]=(0,s.useState)(l),o=(0,m.y6)(i),r=f.$[o],{actionQueueStatus:c,setNextAction:d}=(0,y.c)({errorMessage:r.autoSaveFailed}),{refreshState:u}=(0,g.Z)(),h=(0,x.R9)(u),{syncChanges:p}=(0,b.g)(),S=(0,s.useCallback)(e=>{let{customType:t,onSaveCallback:l,updateMeta:n}=e;a(t),d(async()=>{let{errors:e}=await (0,v.KA)({customType:t,updateMeta:n});if(e.length>0)throw e;h(await (0,v.y0)()),p(),null==l||l()})},[d,h,p]),I=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:i,setCustomType:S}),[c,i,S]);return(0,n.jsx)(j.Provider,{value:I,children:"function"==typeof t?t(I):t})}function I(){let e=(0,s.useContext)(j);if(!e)throw Error("CustomTypeProvider not found");return e}var C=l(30195);function T(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:o}=I(),[r,c]=null!==(e=(0,m.j5)(a))&&void 0!==e?e:[],d=c?(0,m.N3)(c):"",[u,h]=(0,s.useState)(null!=d?d:""),[p,v]=(0,s.useState)();(0,x.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let b=(0,s.useCallback)(()=>(0,n.jsx)(i.aX,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,n.jsxs)(i.ae,{open:t,onOpenChange:l,size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:b,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,n.jsx)(i.al,{title:"Edit the UID label"}),(0,n.jsx)(i.aj,{children:(0,n.jsxs)(i.aJ,{onSubmit:function(){p||(o({customType:c?(0,m.eK)(u,a):(0,m.H8)(u,a)}),l(!1))},children:[(0,n.jsx)(i.D,{flexDirection:"column",padding:16,gap:4,children:(0,n.jsx)(i.aM,{type:"text",label:"Label *",placeholder:"UID",value:u,onValueChange:function(e){h(e),v(function(e){let t=D.safeParse(e,{errorMap:w});if(t.error)return t.error.errors[0].message}(e))},error:p,description:"A label for the UID"})}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",disabled:!!p,children:"Save"})]})]})})]})}let D=C.z.string().max(35).min(1),w=e=>{switch(e.code){case C.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case C.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var k=l(94840),_=l(59532),L=l(63397),A=l(75289);let E=e=>{let{name:t,label:l,placeholder:i,error:a,...o}=e;return(0,n.jsxs)(A.xu,{mb:3,children:[(0,n.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,n.jsx)(L.gN,{name:t,type:"text",placeholder:i,as:A.II,autoComplete:"off",...o}),a?(0,n.jsx)(A.xv,{sx:{color:"error",mt:1},children:a}):null]})};var N=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a}=e;return(0,n.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,onSubmit:e=>{l(e),i()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,n.jsx)(E,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},M=e=>{let{isOpen:t,onSubmit:l,close:i}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,n.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,n.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),i()},children:"Yes, remove tab"})]})})},z=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a,initialTabKey:o}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{id:o},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:o,isValid:r}=e;return(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(E,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&o("id",e.target.value.trim())},onChange:e=>{o("id",e.target.value)}}),(0,n.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!r,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),i()},children:"Save"})]})}})},Z=l(28316),O=l(88932),P=l(35289),F=l(87446),K=l(45440),B=l(16086),R=l(358),U=l(5495),V=l(39302),X=l(3285),G=l(40141),Y=l(65077),q=l(91589),H=l(27213);let Q=e=>{let{openCreateSliceModal:t,openCreateSliceFromImageModal:l,openUpdateSliceZoneModal:a,openSlicesTemplatesModal:o,projectHasAvailableSlices:r,isSlicesTemplatesSupported:s}=e,c=(0,H.F)({menuType:"ActionList"});return(0,n.jsxs)(i.s,{"data-testid":"slice-zone-blank-slate",sx:{width:648},children:[(0,n.jsx)(i.x,{lineColor:"purple9",backgroundColor:"purple5",name:"add",size:"large"}),(0,n.jsx)(i.z,{size:"big",children:"Add slices"}),(0,n.jsx)(i.w,{children:"Slices are reusable website sections. You can use them on different pages and write unique content for each. Each slice has its own component in your code."}),(0,n.jsx)(i.v,{children:(0,n.jsxs)(i.A,{children:[(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromImage.BackgroundIcon,onClick:l,description:c.fromImage.description,children:c.fromImage.title}),(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromScratch.BackgroundIcon,onClick:t,description:c.fromScratch.description,children:c.fromScratch.title}),s&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromTemplate.BackgroundIcon,onClick:o,description:c.fromTemplate.description,children:c.fromTemplate.title}),r&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromExisting.BackgroundIcon,onClick:a,description:c.fromExisting.description,children:c.fromExisting.title})]})})]})};var W=l(98250);function $(e){let{customType:t,tabId:l,slices:n}=e,i={...t};return n.forEach(e=>{i={...i,tabs:i.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),i}var J=l(18566),ee=l(80148);async function et(){try{let{templates:e,errors:t}=await ee.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var el=l(6256),en=l(39204),ei=l(7723),ea=l(33986),eo=l(30527),er=l(55862);let es=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,n.jsx)(er.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,n.jsx)(eo.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:(0,n.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,n.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,n.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,n.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,n.jsx)(ea.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,n.jsx)(ea.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,n.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var ec=l(84879),ed=l(62434),em=l(63908),eu=l(63019),eh=l(65375),ep=l.n(eh);let ex=e=>{var t;let{isOpen:l,close:a,onSubmit:o,isLoading:r,slice:d,libraries:m}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e)})),h={from:null===(t=m[0])||void 0===t?void 0:t.name,sliceName:(0,R.MP)(d.key)},[p,v]=(0,s.useState)(h),[b,y]=(0,s.useState)();function g(e){v(e),y((0,eu.h)(e,m,u))}return(0,x.pQ)(l,()=>{l||(v(h),y(void 0))}),(0,n.jsxs)(i.ae,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Upgrade slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){b&&Object.keys(b).length>0||o({libraryID:p.from,sliceID:p.sliceName})},children:(0,n.jsxs)(i.D,{flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)(i.aM,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,R.MP)(d.key),")"),error:null==b?void 0:b.sliceName,value:p.sliceName,onValueChange:e=>g({...p,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)("label",{className:ep().label,children:(0,n.jsx)(i.bL,{variant:"bold",children:"Slice library *"})}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:p.from,onValueChange:e=>{e&&g({...p,from:e})},children:m.map(e=>(0,n.jsx)(i.bt,{value:e.name,children:e.name},e.name))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:r,disabled:b&&Object.keys(b).length>0,children:"Upgrade"})]})]})})})]})};var ev=l(96009),eb=l.n(ev);let ey=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,slice:d,sliceName:m,libraries:u,localSharedSlices:h}=e,p={libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:eb()(d.key),variationName:m},[v,b]=(0,s.useState)(!0),[y,g]=(0,s.useState)(p),[f,j]=(0,s.useState)({});function S(e){g(e),j(eg(e,u))}return(0,x.pQ)(a,()=>{a||(g(p),j({}))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Convert to slice variation"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){Object.keys(f).length>0||r(y)},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice *"}),"string"==typeof f.libraryID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:f.libraryID}):null,"string"==typeof f.sliceID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:f.sliceID}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(y.libraryID,"::").concat(y.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");S({...y,libraryID:t,sliceID:l})}},children:h.map(e=>(0,n.jsxs)(i.bt,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"Variation name *",placeholder:m,error:f.variationName,value:y.variationName,onValueChange:e=>{let t={...y,variationName:e.slice(0,30)};v&&(t.variationID=eb()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"ID *",placeholder:eb()(d.key),error:f.variationID,value:y.variationID,onValueChange:e=>{b(!1),S({...y,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:Object.keys(f).length>0,children:"Convert"})]})]})})})]})},eg=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let n=t.find(t=>t.path===e.libraryID);l.libraryID||n||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let i=null==n?void 0:n.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||i||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==i?void 0:i.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},ef=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,identicalSlices:d}=e,m=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[u,h]=(0,s.useState)(m),[p,v]=(0,s.useState)();return(0,x.pQ)(a,()=>{a||(h(m),v(void 0))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Merge with an existing slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){if(p)return;let[e,t,l]=u.split("::");r({libraryID:e,sliceID:t,variationID:l})},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice*"}),"string"==typeof p?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:p}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:u,onValueChange:function(e){h(e),e||v("Cannot be empty.")},children:d.map(e=>(0,n.jsx)(i.bt,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:!!p,children:"Merge"})]})]})})})]})},ej=e=>{var t;let{slice:l,path:a}=e,{refreshState:o}=(0,g.Z)(),[r,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(),{setCustomType:h}=I(),{libraries:p}=(0,c.v9)(e=>({libraries:(0,ei.Sd)(e)})),x="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,b=p.filter(e=>e.isLocal),y=b.map(e=>e.components).flat(),f=eS(l,x,y),j=async e=>{var t,n,i;if(!m)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:m});let{errors:r}=await ee.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(n=e.variationName)&&void 0!==n?n:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}});if(r.length)throw console.error("Could not convert slice `".concat(x,"`"),r),O.Am.error("Could not convert slice `".concat(x,"`")),r;let{model:s,errors:c}=await ee.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),O.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(o(await (0,v.y0)()),d(!1),u(void 0),m){case"as_new_slice":O.Am.success("".concat(x," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":O.Am.success("".concat(x," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:O.Am.success("".concat(x," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h({customType:s})},S={path:a,slice:l,sliceName:x,libraries:b,localSharedSlices:y,identicalSlices:f,close:()=>u(void 0),onSubmit:j,isLoading:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,n.jsxs)(i.as,{align:"start",children:[(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>u("as_new_slice"),children:"Upgrade slice"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>u("as_new_variation"),disabled:!y.length,children:"Convert to slice variation"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>u("merge_with_identical"),disabled:!f.length,children:"Merge with another slice"})]})]}),(0,n.jsx)(ex,{...S,isOpen:"as_new_slice"===m}),(0,n.jsx)(ey,{...S,isOpen:"as_new_variation"===m}),(0,n.jsx)(ef,{...S,isOpen:"merge_with_identical"===m})]})},eS=(e,t,l)=>(0,s.useMemo)(()=>{let n=[],i=(0,em.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,em.ux)(t,e.model.name);i.primary===l.primary&&i.items===l.items&&n.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return n},[e,t,l]),eI=e=>{let{slice:t,path:l}=e,[a]=(0,ec.E)("legacySliceUpgrader"),o=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,n.jsxs)(ed.Zb,{children:[(0,n.jsx)(ed.ZB,{component:"div",children:(0,n.jsx)(i.D,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(i.bL,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,n.jsxs)(ed.T$,{children:[(0,n.jsx)(i.c3,{content:o,side:"bottom",children:(0,n.jsx)(i.m,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,n.jsx)(ej,{slice:t,path:l}):null]}),(0,n.jsx)(ed.eW,{subtitle:"1 variation",title:(0,em.Dj)(t.value)})]})};var eC=l(51507),eT=l(21151);let eD=e=>{let{slices:t,format:l,path:i,onRemoveSharedSlice:a}=e,o=t.some(e=>"SharedSlice"!==e.type),r=f.$[l],[c]=(0,ec.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{o&&(c.enabled?O.Am.info("This ".concat(r.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):O.Am.warning("This ".concat(r.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[o]),(0,n.jsx)(eT.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,n.jsx)(eI,{slice:t,path:i})}{let t=e.payload;return(0,n.jsx)(eC.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,location:n,onSuccess:i}=e,{data:a,errors:o}=await ee.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(o.length>0||void 0===a)throw o;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],location:n,mode:"template",sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),O.Am.error(e)}}var ek=l(26109),e_=e=>{let{availableSlices:t,values:l}=e;return(0,n.jsx)(L.F2,{name:"sliceKeys",render:e=>(0,n.jsx)(eT.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{let i=l.sliceKeys.includes(t.model.id);return(0,n.jsx)(eC.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:n=>{n?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:i,slice:t,variant:"outlined"})}})})};let eL=e=>{let{formId:t,close:l,onSuccess:i,availableSlicesTemplates:a,localLibraries:o,location:r}=e,{createSliceSuccess:s}=(0,g.Z)();return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:o.map(e=>e.name),location:r,onSuccess:async e=>{s((await (0,v.y0)()).libraries),i(await Promise.all(e.map(async e=>(await ee.managerClient.slices.readSlice({libraryID:o[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:ek.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})}))})}})};var eA=e=>{let{formId:t,close:l,onSubmit:i,availableSlices:a}=e;return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;i(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a})}})};let eE=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:n,notFound:i}=e.value.reduce((e,t)=>{let{key:n,value:i}=t;if("SharedSlice"===i.type){let t=l.find(e=>e.model.id===n);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:n}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:n,value:i}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:n,notFound:i}};var eN=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:o,onRemoveSharedSlice:r,sliceZone:d,tabId:m}=e,u=(0,J.QT)(et,[]),[h,p]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),[y,f]=(0,s.useState)(!1),[j,S]=(0,s.useState)(!1),{remoteSlices:C,libraries:T}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e),libraries:(0,ei.Sd)(e),slices:(0,ei.xC)(e)})),{setCustomType:D}=I(),{completeStep:w}=(0,W.k)(),{openLoginModal:_}=(0,g.Z)(),L=(0,H.F)({menuType:"Dropdown"}),A=T.filter(e=>e.isLocal),{availableSlices:E,slicesInSliceZone:N,notFound:M}=(0,s.useMemo)(()=>d?eE(d,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,T]),[z,Z]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==M?void 0:M.length)&&M.forEach(e=>{let{key:t}=e;r(t)})},[M]);let F=N.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),K=E.filter(e=>!F.some(t=>t.model.id===e.model.id)),B=()=>{b(!0)},R=()=>{f(!0)},U=async()=>{await ee.managerClient.user.checkIsLoggedIn()?S(!0):_()},V=()=>{p(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},X=()=>{b(!1)},G=()=>{f(!1)},ea=()=>{S(!1)},eo=()=>{p(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.Bu,{actions:d?(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,n.jsxs)(i.as,{align:"end",children:[(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromImage.BackgroundIcon,onSelect:()=>void U(),description:L.fromImage.description,children:L.fromImage.title}),(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromScratch.BackgroundIcon,onSelect:R,description:L.fromScratch.description,children:L.fromScratch.title}),u.length>0?(0,n.jsx)(i.at,{onSelect:V,renderStartIcon:()=>L.fromTemplate.BackgroundIcon,description:L.fromTemplate.description,children:L.fromTemplate.title}):void 0,K.length>0?(0,n.jsx)(i.at,{onSelect:B,renderStartIcon:()=>L.fromExisting.BackgroundIcon,description:L.fromExisting.description,children:L.fromExisting.title}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==m?(0,n.jsx)(i.bC,{checked:!!d,onCheckedChange:e=>{e?a():Z(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?N.length>0?(0,n.jsx)(Y.xR,{children:(0,n.jsx)(eD,{slices:N,format:l.format,path:{customTypeID:l.id,tabID:m,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:r})}):(0,n.jsx)(i.D,{flexDirection:"column",flexGrow:1,justifyContent:"center",alignItems:"center",padding:{block:32},children:(0,n.jsx)(Q,{openUpdateSliceZoneModal:B,openCreateSliceModal:R,openCreateSliceFromImageModal:()=>void U(),openSlicesTemplatesModal:V,projectHasAvailableSlices:K.length>0,isSlicesTemplatesSupported:u.length>0})}):void 0,x&&(0,n.jsx)(eA,{formId:"tab-slicezone-form-".concat(m),availableSlices:K,onSubmit:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success("Slice(s) added to slice zone")}}),w("createSlice"),X()},close:X}),h&&(0,n.jsx)(eL,{formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:u,localLibraries:A,location:"".concat(l.format,"_type"),onSuccess:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),w("createSlice"),eo()},close:eo}),z&&(0,n.jsx)(es,{closeDeleteSliceZoneModal:()=>{Z(!1)},deleteSliceZone:()=>{o(),Z(!1)}}),(null==A?void 0:A.length)!==0&&y&&(0,n.jsx)(el.c,{onSuccess:e=>{let t=$({customType:l,tabId:m,slices:[e]});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),G()},localLibraries:A,location:"".concat(l.format,"_type"),remoteSlices:C,onClose:G}),(0,n.jsx)(q.S,{open:j,location:"".concat(l.format,"_type"),onSuccess:e=>{let{slices:t,library:i}=e,a=$({customType:l,tabId:m,slices:t.map(e=>e.model)});D({customType:k.Dc.fromSM(a),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice(s) added to slice zone and created at: ",path:i}))}}),ea()},onClose:ea})]})};let eM=[K.C.UID,K.C.Image,K.C.Text,K.C.StructuredText,K.C.Link,K.C.Select,K.C.Boolean,K.C.Number,K.C.Color,K.C.Date,K.C.Table,K.C.Embed,K.C.Timestamp,K.C.GeoPoint,K.C.ContentRelationship,K.C.LinkToMedia,K.C.Group,K.C.NestedGroup];var ez=e=>{var t,l,a,o;let{tabId:r}=e,{customType:c,setCustomType:d}=I(),u=k.Dc.toSM(c),h=null===(t=u.tabs.find(e=>e.key===r))||void 0===t?void 0:t.sliceZone,p=null!==(a=null===(l=u.tabs.find(e=>e.key===r))||void 0===l?void 0:l.value)&&void 0!==a?a:[],x="page"===u.format&&u.repeatable?p.filter(e=>"uid"!==e.key):p,v=u.tabs.reduce((e,t)=>[...e,...t.value],[]),b=e=>{var t;let{apiId:l,value:n}=e,i=null===(t=n.config)||void 0===t?void 0:t.label;if((0,B.Ss)(K.C,n.type)||null==i)return;if("Range"===n.type||"IntegrationFields"===n.type||"Separator"===n.type)throw Error("Unsupported Field Type: ".concat(n.type));let a=K.C[n.type];try{a.schema.validateSync(n,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(n.type,'".'))}let o=k.L$.fromSM(n);d({customType:(0,m.xS)({customType:c,newField:o,newFieldId:l,sectionId:r}),onSaveCallback:()=>{O.Am.success("".concat("Group"===n.type?"Group":"Field"," added"))}}),(0,U.V)({id:l,field:o})},y=e=>{let{apiId:t,newKey:l,value:n,inGroupFieldAction:i,updateMeta:a}=e;if((0,B.Ss)(K.C,n.type))return;let o=k.L$.fromSM(n);d({customType:(0,m.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:o,sectionId:r}),onSaveCallback:()=>{"add"===i&&O.Am.success("Field added")},updateMeta:a}),i||(0,V.Z)({previousId:t,id:l,field:o})};return(0,n.jsx)(F.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.D,{padding:32,children:(0,n.jsx)(i.bg,{})}),children:(0,n.jsxs)(P.aV,{border:!1,style:{flexGrow:1},children:[(0,n.jsx)(G.Z,{zoneType:"customType",zoneTypeFormat:null!==(o=c.format)&&void 0!==o?o:"custom",tabId:r,title:"Static zone",dataTip:"",fields:x,poolOfFieldsToCheck:v,showHints:!0,EditModal:X.Z,widgetsArray:eM,onDeleteItem:e=>{d({customType:(0,m.AK)({customType:c,fieldId:e,sectionId:r})})},onSave:e=>""===e.apiId?b({...e,apiId:e.newKey}):y(e),onDragEnd:e=>{if((0,B.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let n=(0,m.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:r});(0,Z.flushSync)(()=>d({customType:n}))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,R.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,R.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,n.jsx)(eN,{customType:u,tabId:r,sliceZone:h,onRemoveSharedSlice:e=>{d({customType:(0,m.EN)({customType:c,sectionId:r,sliceId:e})})},onCreateSliceZone:()=>{d({customType:(0,m.Tr)(c,r)})},onDeleteSliceZone:()=>{d({customType:(0,m.E3)(c,r)})}})]})})})};let eZ=()=>{var e,t,l;let{customType:a,setCustomType:o}=I(),r=k.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=r.tabs[0])||void 0===e?void 0:e.key),[u,h]=(0,s.useState)(),p=(null===(l=r.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.c9,{sx:p?{flexGrow:1}:void 0,children:["page"===a.format?(0,n.jsx)(i.ca,{title:a.repeatable?(0,n.jsx)(T,{}):void 0}):void 0,(0,n.jsxs)(i.cb,{onValueChange:d,value:c,children:[(0,n.jsx)(i.cd,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:r.tabs.map(e=>(0,n.jsx)(i.ce,{menu:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.at,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"edit"}),children:"Rename"}),(0,n.jsx)(i.at,{color:"tomato",disabled:function(e){if(r.tabs.length<=1)return!0;let t=r.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),r.tabs.map(e=>(0,n.jsx)(i.cc,{value:e.key,children:(0,n.jsx)(ez,{tabId:e.key})},e.key))]})]}),(null==u?void 0:u.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(N,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.vB)(a,t)}),d(t)},tabIds:r.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(z,{close:()=>{h(void 0)},initialTabKey:u.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.HO)(a,u.tabKey,t)}),c===u.tabKey&&d(t)},tabIds:r.tabs.filter(e=>e.key!==u.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,n.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(o({customType:(0,m.F$)(a,u.tabKey)}),c===u.tabKey){var e;let t=null===(e=r.tabs.find(e=>e.key!==u.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eO=l(16442),eP=l(78254),eF=l(60867),eK=l(11166),eB=l(34919),eR=l.n(eB);let eU=e=>{let{tabs:t,...l}=e;return(0,n.jsxs)(eK.fC,{...l,className:eR().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,n.jsx)(eK.aV,{className:eR().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,n.jsx)(eK.xz,{className:eR().trigger,value:l,children:(0,n.jsx)(i.bL,{className:eR().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,n.jsx)(eK.VY,{className:eR().content,value:l,children:(0,n.jsx)(i.bn,{className:eR().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eV=l(25661),eX=l(88241),eG=l(32554),eY=l(44621),eq=l.n(eY);let eH=e=>{var t,l;let{inline:a,...o}=e,r=(0,eG.p)();if(!0===a)return(0,n.jsx)("code",{...o,className:eq().inlineCode});let s=(()=>{var e,t,l,n,i;if((null===(t=o.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(n=o.node)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(i=o.className)||void 0===i?void 0:i.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=o.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,n.jsx)(i.W,{...o,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:r})},language:c,code:String(o.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},eQ=e=>{let{markdown:t}=e;return(0,n.jsx)(eV.D,{children:t,linkTarget:"_blank",remarkPlugins:[eX.Z],components:{code:e=>(0,n.jsx)(eH,{...e}),h1:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"pre",variant:"normal"})}})};async function eW(e){let t=JSON.parse(e),{errors:l,documentation:n}=await ee.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return n}var e$=l(65480),eJ=l.n(e$);let e0=e=>{var t;let{model:l}=e,a=(0,eG.p)(),o=(t={kind:"PageSnippet",data:{model:l}},(0,J.QT)(eW,[JSON.stringify(t)])),{completeStep:r}=(0,W.k)();return 0===o.length?null:(0,n.jsxs)(i.ae,{size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",onClick:()=>{r("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,n.jsx)(i.al,{icon:"code",title:"Page snippet"}),(0,n.jsx)("section",{className:eJ().content,children:o.length>1?(0,n.jsx)(eU,{style:{flex:1},tabs:o.map((e,t)=>{let{label:l,content:i}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,n.jsx)(eQ,{markdown:i})}})}):(0,n.jsx)(i.bn,{style:{flex:1,padding:16},children:(0,n.jsx)(eQ,{markdown:o[0].content})})})]})},e1=e=>{let{model:t}=e;return(0,n.jsx)("div",{children:(0,n.jsx)(F.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.E,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,n.jsx)(e0,{model:t})})})})},e4=()=>{let e=(0,r.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eP.Jk)(t,(0,h.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eO.TG)(t)||e.replace("/")},[t,e]),t&&(0,eO.TG)(t))?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,n.jsx)(e6,{customType:t.local})]}):(0,n.jsx)(p.LN,{})},e6=e=>{let{customType:t}=e;return null===t?(0,n.jsx)(p.LN,{}):(0,n.jsx)(p.LN,{children:(0,n.jsx)(S,{initialCustomType:k.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:o,setCustomType:r}=e,s=(0,m.y6)(o),c=h.cd[t.format],x=f.$[t.format];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(p.wd,{children:[(0,n.jsx)(p.Xq,{url:c.tablePagePathname}),(0,n.jsxs)(p.Cx,{children:[(0,n.jsx)(d.g,{children:x.name({start:!0,plural:!0})}),(0,n.jsx)(d.g,{active:!0,children:null!==(l=o.label)&&void 0!==l?l:o.id})]}),(0,n.jsxs)(p.K2,{children:[(0,n.jsx)(u.X,{status:a}),"page"===o.format?(0,n.jsx)(e1,{model:o}):void 0,(0,n.jsx)(eF._,{isChangesLocal:!0,format:s,customType:o,setLocalCustomType:r})]})]}),(0,n.jsx)(p.RN,{children:(0,n.jsx)(i.D,{flexDirection:"column",minWidth:0,children:(0,n.jsx)(eZ,{})})})]})}})})}},84879:function(e,t,l){"use strict";l.d(t,{E:function(){return o}});var n=l(18566),i=l(80148);async function a(){return i.managerClient.project.getSliceMachineConfig()}function o(e){var t,l;let[o,r]=[(0,n.QT)(a,[]),async e=>{await i.managerClient.project.writeSliceMachineConfig({config:e}),(0,n.VA)(a,[],e)}],s=async t=>{let l={...o,labs:{...o.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await r(l)};return[{enabled:null!==(l=null==o?void 0:null===(t=o.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},s]}},34919:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},65480:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},44621:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},65375:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[658],{21442:function(e,i,t){"use strict";t.d(i,{H:function(){return s}});var r=t(2784),n=t(54597);let s=()=>{let{openScreenshotsModal:e}=(0,n.Z)(),[i,t]=(0,r.useState)({sliceFilterFn:e=>e});return{modalPayload:i,onOpenModal:i=>{t(i),e()}}}},68105:function(e,i,t){"use strict";t.d(i,{Z:function(){return O}});var r,n,s=t(52322),l=t(2784),o=t(951),a=t(75100),d=t(56580),c=t(75289),x=t(68238),u=t.n(x);let p=e=>{let{children:i}=e;return(0,s.jsx)("kbd",{className:u().root,children:i})},h=e=>(0,s.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,s.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,s.jsx)("path",{d:"M9.66862 19.9993C11.1406 19.9993 12.3353 18.8047 12.3353 17.3327V14.666H9.66862C8.19662 14.666 7.00195 15.8607 7.00195 17.3327C7.00195 18.8047 8.19662 19.9993 9.66862 19.9993Z",fill:"#0ACF83"}),(0,s.jsx)("path",{d:"M7.00195 12.0007C7.00195 10.5287 8.19662 9.33398 9.66862 9.33398H12.3353V14.6673H9.66862C8.19662 14.6673 7.00195 13.4727 7.00195 12.0007Z",fill:"#A259FF"}),(0,s.jsx)("path",{d:"M7.00195 6.66667C7.00195 5.19467 8.19662 4 9.66862 4H12.3353V9.33333H9.66862C8.19662 9.33333 7.00195 8.13867 7.00195 6.66667Z",fill:"#F24E1E"}),(0,s.jsx)("path",{d:"M12.334 4H15.0007C16.4727 4 17.6673 5.19467 17.6673 6.66667C17.6673 8.13867 16.4727 9.33333 15.0007 9.33333H12.334V4Z",fill:"#FF7262"}),(0,s.jsx)("path",{d:"M17.6673 12.0007C17.6673 13.4727 16.4727 14.6673 15.0007 14.6673C13.5287 14.6673 12.334 13.4727 12.334 12.0007C12.334 10.5287 13.5287 9.33398 15.0007 9.33398C16.4727 9.33398 17.6673 10.5287 17.6673 12.0007Z",fill:"#1ABCFE"})]}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,s.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]});var f=t(30527),v=t(55862),j=t(75966),m=t(34830),g=t(54597);(r=n||(n={})).Mac="Mac",r.Linux="Linux",r.Windows="Windows";let b=()=>{let{userAgent:e}=navigator,i="Linux";return Object.values(n).forEach(t=>{e.includes(t)&&(i=t)}),i};var C=t(76473),y=t(88932),w=t(94160);async function F(e){let{variationId:i,slice:t,file:r,method:n}=e;try{let e=new FormData;e.append("file",r),e.append("libraryName",t.from),e.append("sliceName",t.model.name),e.append("variationId",i);let{errors:s,url:l}=await (0,w.XQ)({libraryName:t.from,sliceId:t.model.id,variationId:i,file:r});if(s.length>0)throw s;return w.Xe.track({event:"screenshot-taken",type:"custom",method:n}),{...t,screenshots:{...t.screenshots,[i]:{url:l}}}}catch(i){let e="Screenshot not saved";console.error(e,i),y.Am.error(e)}}var E=t(77823),k=t(7974);let D=e=>{let{inputFile:i,handleFile:t,children:r,isDragActive:n}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.__,{htmlFor:"input-file",variant:"buttons.white",sx:{p:2,px:0,display:"flex",justifyContent:"center",width:200,alignItems:"center",flex:1},children:r||"Select file"}),(0,s.jsx)("input",{id:"input-file",type:"file",ref:i,style:{display:"none"},accept:k.nG.map(e=>"image/".concat(e)).join(","),onChange:e=>{var i;t(null===(i=e.target.files)||void 0===i?void 0:i[0],n)}})]})},I=()=>(0,s.jsx)(c.kC,{variant:"boxes.centered",sx:{p:2,position:"absolute",height:"100%",width:"100%",background:"rgba(249, 248, 249, 0.7)",backdropFilter:"blur(5px)",zIndex:"1",pointerEvents:"none"},children:(0,s.jsxs)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,s.jsx)(S,{isActive:!0}),(0,s.jsx)(c.xv,{sx:{my:2},children:"Drop file here"}),(0,s.jsx)(c.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})}),S=e=>{let{isActive:i}=e;return(0,s.jsx)(c.kC,{sx:{p:1,borderRadius:"50%",bg:i?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,s.jsx)(o.IEK,{style:{color:i?"#6E56CF":"#6F6E77",fontSize:"34px"}})})};var R=e=>{let{variationID:i,slice:t,imageTypes:r=k.nG,onUploadSuccess:n}=e,o=t.screenshots[i],{saveSliceCustomScreenshotSuccess:a}=(0,g.Z)(),[d,x]=(0,l.useState)(!1),[u,p]=(0,l.useState)(!1),[h,f]=(0,l.useState)(!1);(0,C.y1)(["meta+v","ctrl+v"],()=>void w(),[i,t]);let{FileInputRenderer:v,fileInputProps:j}=function(e){let{onHandleFile:i}=e,t=(0,l.useRef)(null),r=async(e,r)=>{e&&(await i(e,r),(null==t?void 0:t.current)&&(t.current.value=""))};return{handleFile:r,inputFile:t,FileInputRenderer:D,fileInputProps:{inputFile:t,handleFile:r}}}({onHandleFile:async(e,r)=>{f(!0);let s=await F({slice:t,file:e,method:r?"dragAndDrop":"upload",variationId:i});p(!1);let l=null==s?void 0:s.screenshots[i];l&&(a(i,l,s),n&&n(s)),f(!1)}}),m=async e=>{if(e.size>128e6)return y.Am.error("File is too big. Max file size: 128Mb.");f(!0);let r=await F({slice:t,file:e,method:"dragAndDrop",variationId:i}),s=null==r?void 0:r.screenshots[i];s&&(a(i,s,r),n&&n(r)),f(!1)},b="function"==typeof navigator.clipboard.read,w=async()=>{if(b)try{let e=await navigator.clipboard.read();if(void 0!==e[0]){let i=e[0].types.find(e=>r.map(e=>"image/".concat(e)).includes(e));if(void 0!==i){let t=await e[0].getType(i),r=new File([t],"file");return m(r)}}}catch(e){console.error("Could not paste file",e)}},R=e=>i=>{i.preventDefault(),x(e)},H=e=>i=>{i.preventDefault(),p(e)};return(0,s.jsxs)(c.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:R(!0),onDragLeave:R(!1),onDragOver:R(!0),onMouseEnter:H(!0),onMouseLeave:H(!1),onSubmit:e=>e.preventDefault(),onDrop:e=>{var i;e.preventDefault(),x(!1);let t=null===(i=e.dataTransfer.files)||void 0===i?void 0:i[0];if(void 0!==t)return r.some(e=>"image/".concat(e)===t.type)?void m(t):y.Am.error("Only files of type ".concat(r.join(", ")," are accepted."))},children:[h?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$j,{}),(0,s.jsx)(c.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,h||void 0===o?null:(0,s.jsx)(E.q,{src:o.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),h?null:(0,s.jsx)(c.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:u||void 0===o?"visible":"hidden"},children:(0,s.jsx)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,s.jsxs)(c.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,s.jsx)(S,{isActive:d}),(0,s.jsx)(c.xv,{sx:{my:2},children:b?"Paste, drop or ...":"Drop or ..."}),(0,s.jsx)(v,{...j,isDragActive:d}),(0,s.jsx)(c.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),d?(0,s.jsx)(I,{}):null]})};let H=()=>{let e=b(),i=[n.Windows,n.Linux].includes(e)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{children:"ctrl"})," + ",(0,s.jsx)(p,{children:"shift"})," + ",(0,s.jsx)(p,{children:"c"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{children:"cmd"})," + ",(0,s.jsx)(p,{children:"shift"})," + ",(0,s.jsx)(p,{children:"c"})]});return(0,s.jsxs)(c.kC,{sx:{pl:"4px",alignItems:"center",color:"#000",borderRadius:"6px",fontSize:"12px",lineHeight:"24px",border:"1px solid #E4E2E4",boxShadow:"0px 1px 0px 0px rgba(0, 0, 0, 0.04)",width:"100%",minHeight:"40px"},children:[(0,s.jsx)(h,{}),(0,s.jsxs)("div",{children:["Use\xa0",i," to copy any frame as .png, then just paste it here"]})]})},M=e=>{let{isValid:i}=e;return(0,s.jsx)(c.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:i?(0,s.jsx)(o.Ypm,{style:{fontSize:"16px"}}):(0,s.jsx)(a.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},_=e=>{let{slice:i,onSelectVariation:t,variationSelector:r}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.model.name}),(0,s.jsx)(c.xu,{children:(0,s.jsx)(c.xu,{as:"ul",sx:{pl:0,my:3},children:i.model.variations.map(e=>{let{sliceID:n,variationID:l}=r,o=n===i.model.id&&l===e.id;return(0,s.jsx)(c.xu,{as:"li",sx:{listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px",...o&&{bg:"#EDECEE",fontWeight:"500"},":hover":{bg:"#EDECEE"}},onClick:()=>t({sliceID:i.model.id,variationID:e.id}),children:(0,s.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,s.jsx)(M,{isValid:!!i.screenshots[e.id]}),(0,s.jsx)(c.xv,{sx:{ml:2},children:e.name})]})},"".concat(i.model.id,"-").concat(e.id))})})})]})},z=(e,i)=>e||(i.length?{sliceID:i[0].model.id,variationID:i[0].model.variations[0].id}:void 0);function A(e){let{children:i}=e,t=(0,f.W)();return(0,s.jsx)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,background:"gray",p:"16px",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:e=>{var i;return"1px solid ".concat(String(null===(i=e.colors)||void 0===i?void 0:i.borders))}},children:i})}var O=e=>{let{slices:i,defaultVariationSelector:t,onUploadSuccess:r}=e,{closeModals:n}=(0,g.Z)(),{isOpen:o}=(0,d.v9)(e=>({isOpen:(0,j.gP)(e,m.q.SCREENSHOTS)})),[a,x]=(0,l.useState)(z(t,i));if((0,l.useEffect)(()=>{x(z(t,i))},[null==t?void 0:t.sliceID,null==t?void 0:t.variationID,o]),0===i.length||!a)return null;let u="function"==typeof navigator.clipboard.read;return(0,s.jsx)(v.Z,{isOpen:o,shouldCloseOnOverlayClick:!0,onRequestClose:()=>n(),children:(0,s.jsx)(f.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:(0,s.jsxs)(A,{children:[(0,s.jsx)(c.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,s.jsx)(c.x8,{type:"button",onClick:()=>n()})]}),Footer:null,children:(0,s.jsxs)(c.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,s.jsx)(c.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:i.map((e,i)=>(0,s.jsx)(_,{slice:e,variationSelector:a,onSelectVariation:x},"".concat(e.model.id,"-").concat(i)))}),(0,s.jsxs)(c.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[u?(0,s.jsx)(H,{}):void 0,(()=>{let e=i.find(e=>e.model.id===a.sliceID);return e?(0,s.jsx)(R,{variationID:a.variationID,slice:e,onUploadSuccess:r}):null})()]})]})})})}},77823:function(e,i,t){"use strict";t.d(i,{q:function(){return a}});var r=t(52322),n=t(2784),s=t(65186),l=t(75289);let o=(0,n.memo)(e=>{let{src:i}=e;return(0,r.jsx)(l.Ee,{src:i,alt:"Preview image",sx:{maxHeight:"100%"}})}),a=e=>{let{src:i,sx:t}=e;return(0,r.jsx)(l.kC,{sx:{position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px",...t},children:void 0!==i?(0,r.jsx)(o,{src:i}):(0,r.jsxs)(l.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(s.eJU,{}),"You have no screenshot yet."]})})}},68238:function(e){e.exports={root:"Kbd_root__LRA1F"}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[907],{91589:function(e,t,a){a.d(t,{S:function(){return b}});var r=a(52322),i=a(11699),n=a(2784),l=a(76473),s=a(88932),o=a(30195),c=a(94160),d=a(34166),u=a(98250),m=a(68968),p=a(96317),g=a(80148),f=a(54597),h=a(62434);function y(e){let{slice:t}=e,a="uploading"===t.status||"generating"===t.status,n="uploadError"===t.status||"generateError"===t.status,l="generateError"===t.status||"generating"===t.status||"success"===t.status;return(0,r.jsxs)(h.Zb,{disabled:a,children:[l?(0,r.jsx)(h.ZB,{src:t.thumbnailUrl}):(0,r.jsx)(h.ZB,{component:"div"}),(0,r.jsx)(h.eW,{loading:a,startIcon:function(e){switch(e){case"uploadError":case"generateError":return"close";case"success":return"check";default:return}}(t.status),title:"success"===t.status?t.model.name:t.image.name,subtitle:function(e){switch(e){case"uploading":return"Uploading...";case"uploadError":return"Unable to upload image";case"generating":return"Generating...";case"generateError":return"Something went wrong";case"success":return"Generated"}}(t.status),error:n,action:n?(0,r.jsx)(i.E,{startIcon:"refresh",color:"grey",onClick:t.onRetry,children:"Retry"}):void 0})]})}let x=o.z.object({__type:o.z.literal("figma-to-prismic/clipboard-data"),name:o.z.string(),image:o.z.string().startsWith("data:image/")});function b(e){let{open:t,location:a,onSuccess:o,onClose:h}=e,[b,C]=(0,n.useState)([]),[A,I]=(0,n.useState)(!1),{syncChanges:k}=(0,m.g)(),{createSliceSuccess:N}=(0,f.Z)(),{completeStep:E}=(0,u.k)(),F=function(){let e=(0,p.L)("llm-proxy-access");return(null==e?void 0:e.value)==="on"}(),U=(0,n.useRef)(crypto.randomUUID());(0,l.y1)(["meta+v","ctrl+v"],e=>{e.preventDefault(),_()},{enabled:t&&F});let L=e=>{let{index:t,slice:a}=e;C(e=>e.map((e,r)=>r===t?a(e):e))},D=e=>{if(e.length>10){s.Am.error("You can only upload ".concat(10," images at a time."));return}C(e.map(e=>({source:"upload",status:"uploading",image:e}))),e.forEach((e,t)=>z({index:t,image:e,source:"upload"}))},z=e=>{let{index:t,image:a,source:r}=e,i=U.current;L({index:t,slice:e=>({...e,status:"uploading",source:r})}),v({image:a}).then(e=>{i===U.current&&B({index:t,imageUrl:e,source:r})},()=>{i===U.current&&L({index:t,slice:e=>({...e,status:"uploadError",onRetry:()=>z({index:t,image:a,source:r})})})})},P=function(e){let{open:t}=e,a=(0,n.useRef)([]);return(0,n.useEffect)(()=>{t&&(a.current=[],g.managerClient.slices.readAllSlices().then(e=>{a.current=e.models.map(e=>{let{model:t}=e;return t})}).catch(()=>null))},[t]),a}({open:t}),B=async e=>{let{index:t,imageUrl:a,source:r}=e,i=U.current,n=await g.managerClient.project.getSliceMachineConfig().then(e=>{var t;let a=null==e?void 0:null===(t=e.libraries)||void 0===t?void 0:t[0];if(void 0===a)throw Error("No library found in the config.");return a});L({index:t,slice:e=>({...e,status:"generating",thumbnailUrl:a})});try{let e=await g.managerClient.customTypes.inferSlice({imageUrl:a,source:r,libraryID:n});if(i!==U.current)return;let l=function(e){let{existingSlices:t,newSlices:a,slice:r}=e,i=new Set,n=new Set;for(let{id:e,name:a}of t)i.add(e),n.add(a.toLowerCase());for(let e of a)"success"===e.status&&(i.add(e.model.id),n.add(e.model.name.toLowerCase()));let l=r.id,s=2;for(;i.has(l);)l="".concat(r.id,"_").concat(s),s++;let o=r.name;for(s=2;n.has(o.toLowerCase());)o="".concat(r.name).concat(s),s++;return{...r,id:l,name:o}}({existingSlices:P.current,newSlices:b,slice:e.slice});C(r=>r.map((r,i)=>i===t?{...r,status:"success",thumbnailUrl:a,langSmithUrl:e.langSmithUrl,model:l}:r))}catch(e){if(i!==U.current)return;L({index:t,slice:e=>({...e,status:"generateError",thumbnailUrl:a,onRetry:()=>void B({index:t,imageUrl:a,source:r})})})}},_=async()=>{var e;if(!(!t||!F||b.some(e=>"figma"===e.source)||b.some(e=>"uploading"===e.status||"generating"===e.status))){if("function"!=typeof(null===(e=navigator.clipboard)||void 0===e?void 0:e.read)){s.Am.error("Clipboard paste is not supported in this browser.");return}try{let e=await navigator.clipboard.read();if(0===e.length){s.Am.error("No data found in clipboard.");return}let t="pasted-image.png",a=null,r=!1;for(let t of e){let e=t.types.find(e=>e.startsWith("image/"));if(void 0!==e){a=await t.getType(e);break}}for(let i of e)if(i.types.includes("text/plain"))try{let e=await i.getType("text/plain"),n=await e.text(),l=x.safeParse(JSON.parse(n));if(l.success){r=!0;let e=l.data;if(t="".concat(e.name,".png"),!a){let t=await fetch(e.image);a=await t.blob()}}else console.warn("Clipboard data validation failed:",l.error)}catch(e){console.warn("Failed to parse JSON from clipboard:",e)}if(!a){r?s.Am.error("Could not extract Figma data from clipboard. Please try copying again using the Prismic Figma plugin."):s.Am.error("No Figma data found in clipboard. Make sure you've copied a design using the Prismic Figma plugin.");return}let i=b.length;if(i>=10){s.Am.error("You can only upload ".concat(10," images at a time."));return}let n=new File([a],t,{type:a.type});C(e=>[...e,{source:"figma",status:"uploading",image:n}]),z({index:i,image:n,source:"figma"}),s.Am.success("Pasted ".concat(t).concat(r?" from Figma":""))}catch(e){console.error("Failed to paste from clipboard:",e),s.Am.error("Failed to paste from clipboard. Please check browser permissions and try again.")}}},T=b.some(e=>"uploading"===e.status||"generating"===e.status),R=b.filter(e=>"success"===e.status),Z=R.length>0;return(0,r.jsxs)(i.ae,{open:t,onOpenChange:e=>{e||A||(h(),U.current=crypto.randomUUID(),C([]))},children:[(0,r.jsx)(i.al,{title:"Generate from image"}),(0,r.jsxs)(i.aj,{gap:0,children:[(0,r.jsx)(i.ak,{hidden:!0,children:"Upload images to generate slices with AI"}),0===b.length?(0,r.jsx)(i.D,{padding:16,height:"100%",children:(0,r.jsx)(i.aF,{onFilesSelected:D,assetType:"image",maxFiles:10,overlay:(0,r.jsx)(w,{onFilesSelected:D,droppingFiles:!0}),children:(0,r.jsx)(w,{onFilesSelected:D})})}):(0,r.jsx)(i.bn,{stableScrollbar:!1,children:(0,r.jsx)(i.D,{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,padding:16,children:b.map((e,t)=>(0,r.jsx)(y,{slice:e},"slice-".concat(t)))})}),(0,r.jsxs)(i.ah,{children:[(0,r.jsx)(i.ai,{disabled:A}),(0,r.jsxs)(i.af,{disabled:!Z||T,loading:A,onClick:()=>{let e=b.reduce((e,t)=>("success"===t.status&&"upload"===t.source&&e.push(t),e),[]);if(!e.length)return;let t=U.current;I(!0),S(e).then(async e=>{let{slices:r,library:i}=e;if(t===U.current)for(let{model:e,langSmithUrl:t}of(N((await (0,c.y0)()).libraries),k(),o({slices:r,library:i}),I(!1),U.current=crypto.randomUUID(),C([]),E("createSlice"),r))c.Xe.track({event:"slice:created",id:e.id,name:e.name,library:i,location:a,mode:"ai",langSmithUrl:t}),(0,d.nZ)({type:"model",library:i,sliceId:e.id,variationId:e.variations[0].id,langSmithUrl:t})}).catch(()=>{t===U.current&&(I(!1),s.Am.error("An unexpected error happened while adding slices."))})},children:[j(a)," (",R.length,")"]})]})]})]})}function w(e){let{droppingFiles:t=!1,onFilesSelected:a}=e;return(0,r.jsx)(i.D,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:t?"purple2":"grey2",border:!0,borderStyle:"dashed",borderColor:t?"purple9":"grey6",children:(0,r.jsxs)(i.s,{children:[(0,r.jsx)(i.x,{lineColor:"purple11",backgroundColor:"purple5",name:"cloudUpload",size:"large"}),(0,r.jsx)(i.z,{children:"Upload your design images."}),(0,r.jsx)(i.w,{children:"Once uploaded, you can generate slices automatically using AI."}),(0,r.jsx)(i.v,{children:(0,r.jsx)(i.aG,{startIcon:"attachFile",onFilesSelected:a,color:"grey",children:"Add images"})})]})})}async function v(e){let{image:t}=e,a=[await g.managerClient.project.getResolvedRepositoryName(),"shared-slices","prismic-inferred-slices",crypto.randomUUID()].join("/");await g.managerClient.screenshots.initS3ACL();let{url:r}=await g.managerClient.screenshots.uploadScreenshot({keyPrefix:a,data:t});return r}async function S(e){let{libraries:t=[]}=await g.managerClient.project.getSliceMachineConfig(),a=t[0];if(!a)throw Error("No library found in the config.");for(let{model:t}of e){let{errors:e}=await g.managerClient.slices.createSlice({libraryID:a,model:t});if(e.length)throw Error("Failed to create slice ".concat(t.id,"."))}let r=await Promise.all(e.map(async e=>{let{model:t,image:r,langSmithUrl:i}=e;return await g.managerClient.slices.updateSliceScreenshot({libraryID:a,sliceID:t.id,variationID:t.variations[0].id,data:r}),{model:t,langSmithUrl:i}}));return{library:a,slices:r}}let j=e=>{switch(e){case"custom_type":return"Add to type";case"page_type":return"Add to page";case"slices":return"Add to slices"}}},27213:function(e,t,a){a.d(t,{F:function(){return n}});var r=a(52322),i=a(11699);let n=e=>{let{menuType:t}=e;return{fromImage:{BackgroundIcon:(0,r.jsx)(i.B,{name:"autoFixHigh",size:"ActionList"===t?"small":"extraSmall",iconSize:"ActionList"===t?"medium":"small",color:"purple",variant:"solid",radius:6}),title:"Generate from image",description:"Build a slice based on your design image."},fromScratch:{BackgroundIcon:(0,r.jsx)(i.B,{name:"add",size:"ActionList"===t?"small":"extraSmall",iconSize:"ActionList"===t?"medium":"small",color:"white",variant:"solid",radius:6}),title:"Start from scratch",description:"Build a custom slice your way."},fromTemplate:{BackgroundIcon:(0,r.jsx)(i.B,{name:"contentCopy",size:"ActionList"===t?"small":"extraSmall",iconSize:"ActionList"===t?"medium":"small",color:"white",variant:"solid",radius:6}),title:"Use a template",description:"Choose from ready-made examples."},fromExisting:{BackgroundIcon:(0,r.jsx)(i.B,{name:"folder",size:"ActionList"===t?"small":"extraSmall",iconSize:"ActionList"===t?"medium":"small",color:"white",variant:"solid",radius:6}),title:"Reuse an existing slice",description:"Select from your created slices."}}}},6256:function(e,t,a){a.d(t,{c:function(){return b}});var r=a(52322),i=a(2784),n=a(36131),l=a(75289),s=a(94160),o=a(98250),c=a(88932),d=a(63908),u=a(358),m=a(80148);async function p(e){let{sliceName:t,libraryName:a,location:r,onSuccess:i}=e;try{let e=(0,d.fo)(t),{errors:n}=await m.managerClient.slices.createSlice({libraryID:a,model:e});if(n.length>0)throw n;s.Xe.track({event:"slice:created",id:(0,u.MP)(t),name:t,library:a,location:r,mode:"manual"}),await i(e)}catch(a){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,a),c.Am.error(e)}}var g=a(68968),f=a(59532),h=a(54597),y=a(46999),x=a(63019);let b=e=>{let{onClose:t,onSuccess:a,localLibraries:c,location:d,remoteSlices:u}=e,{createSliceSuccess:m}=(0,h.Z)(),[b,w]=(0,i.useState)(!1),{syncChanges:v}=(0,g.g)(),{completeStep:S}=(0,o.k)(),j=async e=>{let t=e.sliceName,r=e.from;w(!0),await p({sliceName:t,libraryName:r,location:d,onSuccess:async e=>{m((await (0,s.y0)()).libraries),a(e,r),v(),S("createSlice")}})};return(0,r.jsx)(f.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:b,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{j(e)},initialValues:{sliceName:"",from:c[0].name},validate:e=>(0,x.h)(e,c,u),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:a,setFieldValue:i,errors:s}=e;return(0,r.jsxs)(l.xu,{children:[(0,r.jsx)(y.W,{name:"sliceName",label:"Slice name",placeholder:"Pascalised slice API ID (e.g. TextBlock)",error:t.sliceName?s.sliceName:void 0,testId:"slice-name-input"}),(0,r.jsx)(l.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,r.jsx)(n.ZP,{name:"from",options:c.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void i("from",e.value):null,defaultValue:{value:a.from,label:a.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},63019:function(e,t,a){a.d(t,{h:function(){return o}});var r=a(96009),i=a.n(r),n=a(74600),l=a.n(n),s=a(7974);function o(e,t,a){let{sliceName:r}=e;return r?s.lS.includes(r.toLowerCase())?{sliceName:'Name "'.concat(r,'" is reserved for Slice Machine use.')}:s.xo.exec(r)?l()(i()(r)).replace(/\s/gm,"")!==r.trim()?{sliceName:"Value has to be PascalCased."}:r.match(/^\d/)?{sliceName:"Value cannot start with a number."}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...a.map(e=>e.name)].includes(r)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed."}:{sliceName:"Cannot be empty"}}},21151:function(e,t,a){var r=a(52322),i=a(75289);t.Z=function(e){let{elems:t,renderElem:a,defineElementKey:n,gridTemplateMinPx:l="320px",gridGap:s="16px",sx:o}=e;return(0,r.jsx)(i.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(l,", 1fr))"),gridGap:s,pt:2,...o},children:t.map((e,t)=>e?(0,r.jsx)("span",{children:a(e,t)},"".concat(n(e),"-").concat(t+1)):null)})}}}]);