slice-machine-ui 1.22.2 → 1.22.3-alpha.chore-introduce-css-modules.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.depcheckrc +4 -1
- package/.eslintignore +1 -0
- package/components/DeleteVariationModal/index.tsx +12 -11
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +2 -5
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +9 -5
- package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +12 -11
- package/components/ItemHeader/index.tsx +1 -0
- package/components/ListItem/index.tsx +5 -2
- package/components/ScreenshotChangesModal/VariationDropZone.tsx +31 -9
- package/components/ScreenshotChangesModal/index.tsx +3 -0
- package/components/ScreenshotChangesModal/useCustomScreenshot.tsx +5 -5
- package/components/Simulator/index.tsx +9 -3
- package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +2 -2
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +2 -2
- package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +12 -20
- package/lib/builders/CustomTypeBuilder/TabModal/update.tsx +3 -1
- package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +119 -52
- package/lib/builders/CustomTypeBuilder/index.tsx +39 -42
- package/lib/builders/SliceBuilder/FieldZones/index.tsx +81 -56
- package/lib/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +24 -16
- package/lib/builders/SliceBuilder/Sidebar/index.tsx +44 -46
- package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +4 -28
- package/lib/builders/SliceBuilder/index.tsx +10 -96
- package/lib/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +5 -1
- package/lib/builders/common/Zone/Card/components/NewField.tsx +16 -15
- package/lib/builders/common/Zone/Card/index.jsx +2 -0
- package/lib/builders/common/Zone/index.jsx +3 -1
- package/lib/models/common/ComponentUI.ts +0 -14
- package/lib/models/common/CustomType/sliceZone.ts +0 -29
- package/lib/models/common/CustomType/tab.ts +10 -142
- package/lib/models/common/widgets/Group/ListItem/index.jsx +61 -23
- package/out/404.html +1 -1
- package/out/_next/static/QLcban0JdGEoFu6NgapR9/_buildManifest.js +1 -0
- package/out/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js +1 -0
- package/out/_next/static/chunks/183-4feb6bb3eddbc768.js +1 -0
- package/out/_next/static/chunks/18539003-7b2711e6c51d6fac.js +97 -0
- package/out/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js +1 -0
- package/out/_next/static/chunks/25-8fedd33ad9b6de5b.js +1 -0
- package/out/_next/static/chunks/286-ed90373e9a469944.js +1 -0
- package/out/_next/static/chunks/318-541db69860d31138.js +1 -0
- package/out/_next/static/chunks/{505-3f1cf09a086dcba8.js → 376-0ed5822f8afcaa7c.js} +3 -3
- package/out/_next/static/chunks/4c744e84-e3161d754618373f.js +1 -0
- package/out/_next/static/chunks/50-cfc2514205b86001.js +1 -0
- package/out/_next/static/chunks/543-f8766685f7f451e2.js +1 -0
- package/out/_next/static/chunks/59b4e022-7a3b5554b806349f.js +1 -0
- package/out/_next/static/chunks/696-b12edad30a3617e5.js +31 -0
- package/out/_next/static/chunks/727-15cf3f2fea9a37e5.js +1 -0
- package/out/_next/static/chunks/731-501990ebe6a71b32.js +1 -0
- package/out/_next/static/chunks/904-ccd8ca3368ce29fc.js +1 -0
- package/out/_next/static/chunks/{918-38d08f1e885b222d.js → 918-5bb55fb464e34768.js} +1 -1
- package/out/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js +1 -0
- package/out/_next/static/chunks/pages/_app-3bb7f58b43c87166.js +430 -0
- package/out/_next/static/chunks/pages/changelog-68d115a14f1423d7.js +1 -0
- package/out/_next/static/chunks/pages/{changes-52c9d917808d1461.js → changes-1cf9e7888029f113.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-3a37eb3373bb8823.js → [customTypeId]-3f862ad6111a1fc0.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-2f5664d9492b13fb.js → custom-types-94b8f8dbf7727412.js} +1 -1
- package/out/_next/static/chunks/pages/{index-d8e3a2c0d712904f.js → index-64cfb8b0948ba8ef.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-733f3890c0466a05.js → [pageTypeId]-d1ffca11c42f2603.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-897ca93c114a1435.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-73dd999915509965.js +1 -0
- package/out/_next/static/chunks/pages/slices-7b09cb5130c63bb3.js +1 -0
- package/out/_next/static/css/37153180c3b0dd66.css +1 -0
- package/out/_next/static/css/538ecf581b0e7c11.css +1 -0
- package/out/_next/static/css/{5da5d3cd7a87c3cf.css → 72465cc1225f28a2.css} +1 -1
- package/out/_next/static/css/{77abb01eee0e43a7.css → b22c0750c14cc089.css} +1 -1
- package/out/_next/static/css/f8eb526e10bc2441.css +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +21 -11
- package/pages/slices/[lib]/[sliceName]/[variation]/index.tsx +25 -11
- package/pages/slices/[lib]/[sliceName]/[variation]/simulator.tsx +12 -9
- package/src/apiClient.ts +7 -6
- package/src/components/CodeBlock/CodeBlock.tsx +1 -0
- package/src/components/Kbd/Kbd.module.css +10 -0
- package/src/components/Kbd/Kbd.module.css.d.ts +5 -0
- package/src/components/Kbd/Kbd.tsx +1 -1
- package/src/components/Window/Window.tsx +7 -1
- package/src/domain/__tests__/customType.test.ts +785 -0
- package/src/domain/customType.ts +519 -6
- package/src/domain/slice.ts +166 -1
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +43 -0
- package/src/features/autoSave/useAutoSave.tsx +177 -0
- package/src/features/customTypes/EditDropdown.tsx +3 -0
- package/src/features/customTypes/actions/convertCustomToPageType.ts +2 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +90 -0
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +46 -79
- package/src/features/customTypes/customTypesMessages.ts +4 -0
- package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -7
- package/src/features/slices/actions/uploadSliceScreenshot.ts +45 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +5 -5
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +4 -10
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +110 -0
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +8 -24
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +8 -24
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +1 -0
- package/src/hooks/useCurrentSlice.tsx +4 -16
- package/src/hooks/useScreenshotChangesModal.ts +1 -0
- package/src/hooks/useServerState.ts +1 -58
- package/src/modules/availableCustomTypes/index.ts +8 -3
- package/src/modules/simulator/index.ts +0 -2
- package/src/modules/slices/index.ts +32 -25
- package/src/modules/slices/selector.ts +30 -0
- package/src/modules/useSliceMachineActions.ts +20 -270
- package/src/redux/reducer.ts +0 -4
- package/src/redux/saga.ts +0 -6
- package/src/redux/type.ts +0 -4
- package/stylelint.config.js +17 -0
- package/test/src/modules/availableCustomTypes/index.test.ts +8 -10
- package/test/src/modules/simulator.test.ts +0 -2
- package/lib/models/common/CustomType/group.ts +0 -80
- package/lib/models/common/Variation.ts +0 -100
- package/out/_next/static/3vLhj_JZ10e4rwC2sTZNQ/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-4460ccbfe3109578.js +0 -97
- package/out/_next/static/chunks/482-49264466566eac99.js +0 -1
- package/out/_next/static/chunks/550-c80fd46fb64d1eef.js +0 -1
- package/out/_next/static/chunks/80-7b8a97d0122ff74a.js +0 -1
- package/out/_next/static/chunks/840-163f8a1040e6820d.js +0 -1
- package/out/_next/static/chunks/904-fe1af089657fb0cc.js +0 -1
- package/out/_next/static/chunks/958-3d829456f4f5632c.js +0 -1
- package/out/_next/static/chunks/pages/_app-f88a66f6532a8e87.js +0 -458
- package/out/_next/static/chunks/pages/changelog-4d0f2f1222e403fe.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-7b17cb59d0db03b5.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ef11594ce026b650.js +0 -1
- package/out/_next/static/chunks/pages/slices-884a936a9a062a65.js +0 -1
- package/out/_next/static/css/1bbf650dfd37ce69.css +0 -1
- package/out/_next/static/css/7d650bca12dc4061.css +0 -1
- package/out/_next/static/css/cb33580e45d01b59.css +0 -1
- package/postcss.config.js +0 -2
- package/src/components/Kbd/Kbd.css.ts +0 -16
- package/src/domain/__tests__/CustomTypeModel.test.ts +0 -247
- package/src/layouts/WithSlice.tsx +0 -26
- package/src/modules/screenshots/actions.ts +0 -21
- package/src/modules/screenshots/sagas.ts +0 -70
- package/src/modules/selectedCustomType/actions.ts +0 -147
- package/src/modules/selectedCustomType/index.ts +0 -11
- package/src/modules/selectedCustomType/reducer.ts +0 -287
- package/src/modules/selectedCustomType/sagas.ts +0 -72
- package/src/modules/selectedCustomType/selectors.ts +0 -33
- package/src/modules/selectedCustomType/stateHelpers.ts +0 -42
- package/src/modules/selectedCustomType/types.ts +0 -9
- package/src/modules/selectedSlice/actions.ts +0 -106
- package/src/modules/selectedSlice/reducer.ts +0 -175
- package/src/modules/selectedSlice/sagas.ts +0 -72
- package/src/modules/selectedSlice/selectors.ts +0 -55
- package/src/modules/selectedSlice/types.ts +0 -3
- package/src/modules/toaster/utils.tsx +0 -23
- package/test/lib/models/common/CustomType/sliceZone.test.ts +0 -49
- package/test/pages/custom-types.test.tsx +0 -625
- package/test/src/modules/selectedCustomType/__fixtures__/model.json +0 -119
- package/test/src/modules/selectedCustomType/reducer.test.ts +0 -322
- package/test/src/modules/selectedCustomType/sagas.test.ts +0 -89
- package/test/src/modules/selectedCustomType/selectors.test.ts +0 -54
- package/test/src/modules/selectedSlice/__fixtures__/mocks.json +0 -171
- package/test/src/modules/selectedSlice/__fixtures__/model.json +0 -35
- package/test/src/modules/selectedSlice/__testutils__/getRefreshStateCreatorPayloadData.ts +0 -72
- package/test/src/modules/selectedSlice/__testutils__/getSelectedSliceDummyData.ts +0 -30
- package/test/src/modules/selectedSlice/reducer.test.ts +0 -170
- package/test/src/modules/selectedSlice/sagas.test.ts +0 -82
- package/test/src/modules/toaster/utils.test.ts +0 -50
- /package/out/_next/static/{3vLhj_JZ10e4rwC2sTZNQ → QLcban0JdGEoFu6NgapR9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[904],{45466:function(e,n,t){"use strict";t.d(n,{c:function(){return g}});var i=t(22710),r=t(62230),a=t(85244),l=t(99267),s=t(52322),c=t(75289),o=t(2784),d=t(36131),u=t(68780),f=t(88932),m=t(38876),h=t(81038),v=t(82770);function p(){return(p=(0,i.Z)(function(e){var n,t,i,r,a,s,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:var o;return l.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,o=n,r={id:(0,m.T3)(o),type:"SharedSlice",name:o,description:o,variations:[{id:x,name:(0,m.MP)(x),docURL:"...",version:"initial",description:(0,m.MP)(x),imageUrl:""},]},[4,h.j.slices.createSlice({libraryID:t,model:r})];case 1:if((a=l.sent().errors).length>0)throw a;return v.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 2:return l.sent(),[3,4];case 3:return s=l.sent(),c="Internal Error: Slice not created",console.error(c,s),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var x="default",y=t(90374),j=t(66443),b=t(70041),g=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,h=e.remoteSlices,x=(0,y.Z)().createSliceSuccess,g=(0,o.useState)(!1),C=g[0],S=g[1],_=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var a;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return p.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(a=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,v.y0)()];case 1:return x(n.sent().libraries),f(e,t),[2]}})}),function(e){return a.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,s.jsx)(u.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:C,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){_(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,j.h)(e,m,h)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(b.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,s.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,s.jsx)(d.ZP,{name:"from",options:m.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,a.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,a.Z)((0,r.Z)({},e),{colors:(0,a.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return o}});var i=t(81541),r=t(75329),a=t(96009),l=t.n(a),s=t(74600),c=t.n(s);function o(e,n,t){var a=e.sliceName;if(!a)return{sliceName:"Cannot be empty"};if(!r.xo.exec(a))return{sliceName:"No special characters allowed"};if(c()(l()(a)).replace(/\s/gm,"")!==a.trim())return{sliceName:"Value has to be PascalCased"};if(a.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(a))return{sliceName:"".concat(a," is reserved for Slice Machine use")};var s=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),o=t.map(function(e){return e.name});if((0,i.Z)(s).concat((0,i.Z)(o)).includes(a))return{sliceName:"Slice name is already taken."}}},59469:function(e,n,t){"use strict";var i=t(62230),r=t(52322),a=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,s=e.gridTemplateMinPx,c=e.gridGap,o=e.sx;return(0,r.jsx)(a.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===s?"320px":s,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},o),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},12904:function(e,n,t){"use strict";t.d(n,{H:function(){return nr}});var i=t(52322),r=t(22715),a=t(97729),l=t.n(a),s=t(5632),c=t(2784),o=t(56580),d=t(22337),u=t(62230),f=t(85244),m=t(98240),h=t(50002),v=t(73844);t(82432);var p="_1k08lzu5 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d32 _1ecs97daf _1ecs97df0v",x=function(e){return(0,i.jsx)("div",(0,f.Z)((0,u.Z)({},e),{className:"_1k08lzu2 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d1u _1ecs97d97 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezr"}))},y=function(e){return(0,i.jsx)("div",(0,f.Z)((0,u.Z)({},e),{className:"_1k08lzu3 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfhl",children:(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97df92",children:[(0,i.jsx)("span",{className:p}),(0,i.jsx)("span",{className:p}),(0,i.jsx)("span",{className:p})]})}))},j=function(e){return(0,i.jsx)(v.fC,(0,f.Z)((0,u.Z)({},e),{activationMode:"manual",className:"_1k08lzu6 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97dezd"}))},b=function(e){var n=e.children,t=e.onAddNewTab,a=(0,m.Z)(e,["children","onAddNewTab"]);return(0,i.jsxs)(v.aV,(0,f.Z)((0,u.Z)({},a),{className:"_1k08lzu7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dezq",children:[n,(0,i.jsx)("div",{className:"_1k08lzuc _1k08lzu8 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfgy _1ecs97d1u _1ecs97d97 _1ecs97dfhi _1ecs97dezw _1ecs97dfc1",children:(0,i.jsx)(r.hU,{icon:"add",onClick:t,hiddenLabel:"Add new tab"})})]}))},g=function(e){var n=e.children,t=e.menu,a=e.value,l=(0,m.Z)(e,["children","menu","value"]);return(0,i.jsx)(v.xz,(0,f.Z)((0,u.Z)({},l),{"aria-label":a,asChild:!0,onMouseDown:function(e){var n=e.target,t=(0,h.JY)(n);t!==e.currentTarget&&t!==e.currentTarget.parentElement&&e.preventDefault(),n===e.currentTarget&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},value:a,children:(0,i.jsxs)("div",{className:"_1k08lzu9 _1k08lzu8 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfgy _1ecs97dez1 _1ecs97da62 _1ecs97dadf _1ecs97df41 _1ecs97df92 _1ecs97dfhl _1ecs97dezv",children:[(0,i.jsx)(r.xv,{className:"_1ecs97dezv _1ecs97dezd",color:"inherit",component:"span",noWrap:!0,variant:"emphasized",children:n}),Boolean(t)?(0,i.jsx)("div",{className:"_1k08lzub _1ecs97dezv _1ecs97df0i",children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.hU,{icon:"moreVert",hiddenLabel:"tab-".concat(a,"-menu-button")})}),(0,i.jsx)(r.AW,{align:"start",children:t})]})}):void 0]})}))},C=function(e){return(0,i.jsx)(v.VY,(0,f.Z)((0,u.Z)({},e),{className:"_1k08lzud _1ecs97dez0 _1ecs97d18 _1ecs97d8l _1ecs97dez3 _1ecs97dezd"}))},S=t(81787),_=t(14137),I=t(91061),w=t(68780),Z=t(63397),T=t(75289),k=function(e){var n=e.name,t=e.label,r=e.placeholder,a=e.error,l=(0,m.Z)(e,["name","label","placeholder","error"]);return(0,i.jsxs)(T.xu,{mb:3,children:[(0,i.jsx)(T.__,{htmlFor:n,mb:2,children:t}),(0,i.jsx)(Z.gN,(0,u.Z)({name:n,type:"text",placeholder:r,as:T.II,autoComplete:"off"},l)),a?(0,i.jsx)(T.xv,{sx:{color:"error",mt:1},children:a}):null]})},z=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds;return(0,i.jsx)(w.Z,{isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,onSubmit:function(e){t(e),r()},initialValues:{id:""},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:function(e){var n=e.errors;return(0,i.jsx)(k,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id})}})},D=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close;return(0,i.jsx)(w.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{},content:{title:"Remove Tab"},children:function(){return(0,i.jsxs)(T.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(T.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(T.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(T.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:function(){t({}),r()},children:"Yes, remove tab"})]})}})},N=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds,l=e.initialTabKey;return(0,i.jsx)(w.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{id:l},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:function(e){var n=e.errors,a=e.values,l=e.setFieldValue,s=e.isValid;return(0,i.jsxs)(T.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(k,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id,onBlur:function(e){a.id!==e.target.value&&l("id",e.target.value.trim())},onChange:function(e){l("id",e.target.value)}}),(0,i.jsx)(T.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!s,onClick:function(){a.id&&a.id.length&&t({id:a.id.trim()}),r()},children:"Save"})]})}})},L=t(81541),V=t(28316),M=t(13394),E=[M.UID,M.Group,M.StructuredText,M.Image,M.Link,M.LinkToMedia,M.ContentRelationship,M.Select,M.Boolean,M.Date,M.Timestamp,M.Embed,M.Number,M.GeoPoint,M.Color,M.Text,],F=t(83462),A=t(28173),P=t(82770),H=t(38876),O=t(4092),R=t(8482),K=t(65077),U=t(88932),B=t(45466),X=t(2754),G=function(e){return(0,i.jsxs)("svg",(0,f.Z)((0,u.Z)({width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}))},q=function(e){var n=e.openCreateSliceModal,t=e.openUpdateSliceZoneModal,a=e.openSlicesTemplatesModal,l=e.projectHasAvailableSlices,s=e.isSlicesTemplatesSupported;return(0,i.jsx)(r.xu,{flexGrow:1,justifyContent:"center","data-cy":"slice-zone-blank-slate",children:(0,i.jsx)(X.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(X.T9,{children:[(0,i.jsx)(r.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(G,{})}),(0,i.jsx)(X._T,{children:"Add slices"}),(0,i.jsx)(X.nf,{children:"Slices are website sections that you can reuse on different pages with different content. Each slice has its own component in your code."}),(0,i.jsx)(X.Qj,{children:(0,i.jsxs)(r.S0,{children:[(0,i.jsx)(r.F8,{startIcon:"add",onClick:n,description:"Start from scratch.",children:"Create new"}),s?(0,i.jsx)(r.F8,{startIcon:"contentCopy",onClick:a,description:"Select from premade examples.",endAdornment:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,l?(0,i.jsx)(r.F8,{startIcon:"folder",onClick:t,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})},J=t(75992),Y=t(22710),W=t(17064),$=t(99267),Q=t(17329),ee=t(81038);function en(){return et.apply(this,arguments)}function et(){return(et=(0,Y.Z)(function(){var e,n,t;return(0,$.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,ee.j.sliceTemplateLibrary.readLibrary({})];case 1:if(n=(e=i.sent()).templates,(t=e.errors).length>0)throw t;return[2,n.map(function(e){return{model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(function(e){var n=(0,W.Z)(e,2),t=n[0],i=n[1];return[t,URL.createObjectURL(i),]}))}})];case 2:return i.sent(),[2,[]];case 3:return[2]}})})).apply(this,arguments)}function ei(e){var n=e.customType,t=e.tabId,i=e.slices,r=(0,u.Z)({},n);return i.forEach(function(e){r=(0,f.Z)((0,u.Z)({},r),{tabs:r.tabs.map(function(n){return n.key===t&&n.sliceZone?(0,f.Z)((0,u.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:[{key:e.id,value:e},].concat((0,L.Z)(n.sliceZone.value))}}):n})})}),P.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:n.id}),r}var er=t(13858),ea=t(56577),el=t(54132),es=t(25812),ec=function(e){var n=e.deleteSliceZone,t=e.closeDeleteSliceZoneModal;return(0,i.jsx)(es.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:t,children:(0,i.jsx)(el.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:function(){return(0,i.jsxs)(T.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsx)(T.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(T.x8,{type:"button",onClick:t})]})},Footer:function(){return(0,i.jsxs)(T.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(ea.z,{label:"Cancel",variant:"secondary",onClick:t,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ea.z,{label:"Delete",variant:"danger",onClick:n,sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsx)(T.nv,{children:"You're about to delete Slice Zone."})})})},eo=t(59469),ed=t(71749),eu=function(e){var n=e.availableSlices,t=e.values,r=e.placeholderSlices;return(0,i.jsx)(Z.F2,{name:"sliceKeys",render:function(e){return(0,i.jsx)(eo.Z,{gridTemplateMinPx:"200px",elems:n,defineElementKey:function(e){return"".concat(e.from,"-").concat(e.model.name)},renderElem:function(n){var a,l=null!==(a=null==r?void 0:r.some(function(e){return e.model.id===n.model.id}))&&void 0!==a&&a,s=t.sliceKeys.includes(n.model.id);return(0,i.jsx)(ed.b,{action:{type:"checkbox"},isComingSoon:l,mode:"selection",onSelectedChange:function(i){i?e.push(n.model.id):e.remove(t.sliceKeys.indexOf(n.model.id))},selected:s,slice:n,variant:"outlined"})}})}})},ef=function(e){var n=e.formId,t=e.close,r=e.onSubmit,a=e.availableSlices;return(0,i.jsx)(w.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){r(e.sliceKeys.map(function(e){var n;return null===(n=a.find(function(n){return n.model.id===e}))||void 0===n?void 0:n.model}).filter(function(e){return void 0!==e}))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},dataCy:"update-slices-modal",validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(T.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eu,{values:n,availableSlices:a})}})},em=t(67557),eh=t(53559);function ev(){return(ev=(0,Y.Z)(function(e){var n,t,i,r,a,l,s,c;return(0,$.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),n=e.templateIDs,t=e.localLibrariesNames,i=e.onSuccess,[4,ee.j.sliceTemplateLibrary.createSlices({templateIDs:n})];case 1:if(a=(r=o.sent()).data,(l=r.errors).length>0||void 0===a)throw l;return a.sliceIDs.forEach(function(e,i){P.Xe.track({event:"slice:created",id:e,name:e,library:t[0],sliceTemplate:n[i]})}),[4,i(a.sliceIDs)];case 2:return o.sent(),[3,4];case 3:return s=o.sent(),c="Internal Error: Slice(s) not created",console.error(c,s),U.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var ep=t(90374),ex=[{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:{id:"video_highlights",name:"VideoHighlights",type:"SharedSlice",variations:[{description:"",docURL:"",id:"default",name:"Default",version:"sktwi1xtmkfgx8626"},]},screenshots:{default:{url:"/videoHighlights.png"}}},],ey=function(e){var n=e.formId,t=e.close,r=e.onSuccess,a=e.availableSlicesTemplates,l=e.localLibraries,s=(0,ep.Z)().createSliceSuccess;return(0,i.jsx)(w.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){var n;!function(e){return ev.apply(this,arguments)}({templateIDs:e.sliceKeys,localLibrariesNames:l.map(function(e){return e.name}),onSuccess:(n=(0,Y.Z)(function(e){var n,t;return(0,$.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,P.y0)()];case 1:var t;return s(n.sent().libraries),[4,Promise.all(e.map((t=(0,Y.Z)(function(e){var n;return(0,$.__generator)(this,function(n){switch(n.label){case 0:return[4,ee.j.slices.readSlice({libraryID:l[0].name,sliceID:e})];case 1:return[2,n.sent().model]}})}),function(e){return t.apply(this,arguments)})).filter(function(e){return void 0!==e}))];case 2:return r(n.sent()),[2]}})}),function(e){return n.apply(this,arguments)})})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(T.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eu,{values:n,placeholderSlices:ex,availableSlices:(0,L.Z)(a.map(function(e){return{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eh.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce(function(e,n){return(0,f.Z)((0,u.Z)({},e),(0,em.Z)({},n[0],{url:n[1]}))},{})}})).concat((0,L.Z)(ex))})}})},ej=t(40432),eb=t(78656),eg=t(24804),eC=t(5479),eS=t(65988),e_=t(66443),eI="_1ecs97dez4 _1ecs97dez8 _1ecs97df90",ew="_1ecs97df77 _1ecs97dez2 _1ecs97df92 _1ecs97dfhl _1ecs97dfg9",eZ=function(e){var n,t=e.isOpen,a=e.close,l=e.onSubmit,s=e.isLoading,c=e.slice,d=e.libraries,u=(0,o.v9)(function(e){return{remoteSlices:(0,J.sT)(e)}}).remoteSlices;return(0,i.jsxs)(r.Vq,{open:t,onOpenChange:function(e){return!e&&a()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Upgrade slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(Z.J9,{validateOnChange:!0,validateOnMount:!0,initialValues:{from:null===(n=d[0])||void 0===n?void 0:n.name,sliceName:(0,H.MP)(c.key)},validate:function(e){return(0,e_.h)(e,d,u)},onSubmit:function(e){l({libraryID:e.from,sliceID:e.sliceName})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-slice-dialog",children:(0,i.jsxs)(r.xu,{flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ew,style:{width:448},children:[(0,i.jsx)(r.xv,{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,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Display name*"}),"string"==typeof e.errors.sliceName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceName}):null]}),(0,i.jsx)(r.yt,{placeholder:"Pascalised Slice API ID (e.g. ".concat((0,H.MP)(c.key),")"),error:"string"==typeof e.errors.sliceName,value:e.values.sliceName,onValueChange:function(n){e.setFieldValue("sliceName",n.slice(0,30))},"data-cy":"slice-name-input"}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Slice library*"}),"string"==typeof e.errors.from?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.from}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:e.values.from,onValueChange:function(n){return n?void e.setFieldValue("from",n):null},children:d.map(function(e){return(0,i.jsx)(r.Ql,{value:e.name,children:e.name},e.name)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Upgrade",onClick:function(){e.submitForm()},loading:s,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eT=t(76635),ek=function(e){var n,t,a=e.isOpen,l=e.close,s=e.onSubmit,o=e.isLoading,d=e.slice,m=e.sliceName,h=e.libraries,v=e.localSharedSlices,p=(0,c.useState)(!0),x=p[0],y=p[1];return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Convert to slice variation"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(Z.J9,{validateOnChange:!0,initialValues:{libraryID:null===(n=v[0])||void 0===n?void 0:n.from,sliceID:null===(t=v[0])||void 0===t?void 0:t.model.id,variationID:(0,eT.camelCase)(d.key),variationName:m},validate:function(e){return ez(e,h)},onSubmit:function(e){s(e)},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-variation-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ew,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.libraryID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.libraryID}):null,"string"==typeof e.errors.sliceID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceID}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(e.values.libraryID,"::").concat(e.values.sliceID),onValueChange:function(n){if(n){var t=(0,W.Z)(n.split("::"),2),i=t[0],r=t[1];e.setFieldValue("libraryID",i),e.setFieldValue("sliceID",r)}},children:v.map(function(e){return(0,i.jsxs)(r.Ql,{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,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(r.yt,{placeholder:m,error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){var t=(0,f.Z)((0,u.Z)({},e.values),{variationName:n.slice(0,30)});x&&(t.variationID=(0,eT.camelCase)(t.variationName)),e.setValues(t,!0)},"data-cy":"variation-name-input"})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"ID*"}),"string"==typeof e.errors.variationID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationID}):null]}),(0,i.jsx)(r.yt,{placeholder:(0,eT.camelCase)(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:function(n){y(!1),e.setFieldValue("variationID",(0,eT.camelCase)(n.slice(0,30)))},"data-cy":"variation-id-input"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Convert",onClick:function(){e.submitForm()},loading:o,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},ez=function(e,n){var t,i={};e.libraryID||(i.libraryID="Cannot be empty.");var r=n.find(function(n){return n.path===e.libraryID});i.libraryID||r||(i.libraryID="Does not exist."),e.sliceID||(i.sliceID="Cannot be empty.");var a=null==r?void 0:r.components.find(function(n){return n.model.id===e.sliceID});return(i.sliceID||a||(i.sliceID="Does not exist."),e.variationName||(i.variationName="Cannot be empty."),e.variationID)?(null!==(t=null==a?void 0:a.model.variations.map(function(e){return e.id}))&&void 0!==t?t:[]).includes(e.variationID)&&(i.variationID="Slice variation ID is already taken."):i.variationID="Cannot be empty.",i},eD=function(e){var n,t,a=e.isOpen,l=e.close,s=e.onSubmit,c=e.isLoading,o=e.identicalSlices;return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(Z.J9,{validateOnChange:!0,initialValues:{path:null!==(t=null===(n=o[0])||void 0===n?void 0:n.path)&&void 0!==t?t:""},validate:function(e){if(!e.path)return{path:"Cannot be empty."}},onSubmit:function(e){var n,t=(0,W.Z)(e.path.split("::"),3),i=t[0];s({libraryID:i,sliceID:t[1],variationID:t[2]})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-merge-with-identical-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ew,style:{width:448},children:[(0,i.jsx)(r.xv,{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,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.path?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.path}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:e.values.path,onValueChange:function(n){n&&e.setFieldValue("path",n)},children:o.map(function(e){return(0,i.jsx)(r.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Merge",onClick:function(){e.submitForm()},loading:c,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eN=function(e){var n,t,a=e.slice,l=e.path,s=(0,ep.Z)(),d=s.refreshState,m=s.openToaster,h=(0,c.useState)(!1),v=h[0],p=h[1],x=(0,c.useState)(),y=x[0],j=x[1],b=(0,S.G)().setCustomType,g=(0,o.v9)(function(e){return{libraries:(0,J.Sd)(e)}}).libraries,C="Slice"===a.value.type&&null!==(n=a.value.fieldset)&&void 0!==n?n:a.key,_=g.filter(function(e){return e.isLocal}),I=_.map(function(e){return e.components}).flat(),w=eL(a,C,I),Z=(t=(0,Y.Z)(function(e){var n,t,i,r,s,c,o,h;return(0,$.__generator)(this,function(h){switch(h.label){case 0:if(!y)return[2];return p(!0),P.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(n=e.variationID)&&void 0!==n?n:"default",library:e.libraryID,conversionType:y}),[4,ee.j.slices.convertLegacySliceToSharedSlice({model:a.value,src:(0,f.Z)((0,u.Z)({},l),{sliceID:a.key}),dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(t=e.variationName)&&void 0!==t?t:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}})];case 1:if((r=h.sent().errors).length)throw console.error("Could not convert slice `".concat(C,"`"),r),m("Could not convert slice `".concat(C,"`"),ej.Jf.ERROR),r;return[4,ee.j.customTypes.readCustomType({id:l.customTypeID})];case 2:if(c=(s=h.sent()).model,(o=s.errors).length||!c)return console.error("Could not refresh custom type view `".concat(l.customTypeID,"`"),o),m("Could not refresh custom type view `".concat(l.customTypeID,"`"),ej.Jf.ERROR),[2];return[4,(0,P.y0)()];case 3:switch(d(h.sent()),p(!1),j(void 0),y){case"as_new_slice":m("".concat(C," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID),ej.Jf.SUCCESS);break;case"as_new_variation":m("".concat(C," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID),ej.Jf.SUCCESS);break;default:m("".concat(C," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID),ej.Jf.SUCCESS)}return b(c),[2]}})}),function(e){return t.apply(this,arguments)}),T={path:l,slice:a,sliceName:C,libraries:_,localSharedSlices:I,identicalSlices:w,close:function(){return j(void 0)},onSubmit:Z,isLoading:v};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{"data-cy":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(r.AW,{align:"start",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:function(){return j("as_new_slice")},children:"Upgrade slice"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:function(){return j("as_new_variation")},disabled:!I.length,children:"Convert to slice variation"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:function(){return j("merge_with_identical")},disabled:!w.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eZ,(0,f.Z)((0,u.Z)({},T),{isOpen:"as_new_slice"===y})),(0,i.jsx)(ek,(0,f.Z)((0,u.Z)({},T),{isOpen:"as_new_variation"===y})),(0,i.jsx)(eD,(0,f.Z)((0,u.Z)({},T),{isOpen:"merge_with_identical"===y}))]})},eL=function(e,n,t){return(0,c.useMemo)(function(){var i=[],r=(0,eC.ux)(e.value,n),a=!0,l=!1,s=void 0;try{for(var c,o=t[Symbol.iterator]();!(a=(c=o.next()).done);a=!0){var d=c.value,u=!0,f=!1,m=void 0;try{for(var h,v=d.model.variations[Symbol.iterator]();!(u=(h=v.next()).done);u=!0){var p=h.value,x=(0,eC.ux)(p,d.model.name);r.primary===x.primary&&r.items===x.items&&i.push({libraryID:d.from,sliceID:d.model.id,variationID:p.id,path:"".concat(d.from,"::").concat(d.model.id,"::").concat(p.id)})}}catch(y){f=!0,m=y}finally{try{u||null==v.return||v.return()}finally{if(f)throw m}}}}catch(j){l=!0,s=j}finally{try{a||null==o.return||o.return()}finally{if(l)throw s}}return i},[e,n,t])},eV=function(e){var n=e.slice,t=e.path,a=(0,W.Z)((0,eS.E)("legacySliceUpgrader"),1)[0],l=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,i.jsxs)(eg.Zb,{children:[(0,i.jsx)(eg.ZB,{component:"div",children:(0,i.jsx)(r.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(r.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eg.T$,{children:[(0,i.jsx)(r.u,{content:l,side:"bottom",children:(0,i.jsx)(r.Ct,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,i.jsx)(eN,{slice:n,path:t}):null]}),(0,i.jsx)(eg.eW,{subtitle:"1 variation",title:(0,eC.Dj)(n.value)})]})},eM=function(e){var n=e.slices,t=e.format,r=e.path,a=e.onRemoveSharedSlice,l=n.some(function(e){return"SharedSlice"!==e.type}),s=eb.$[t],o=(0,W.Z)((0,eS.E)("legacySliceUpgrader"),1)[0],d=(0,ep.Z)().openToaster;return(0,c.useEffect)(function(){l&&(o.enabled?d("This ".concat(s.name({start:!1,plural:!1})," contains legacy slices that can be upgraded."),ej.Jf.INFO):d("This ".concat(s.name({start:!1,plural:!1})," contains slices that are incompatible."),ej.Jf.WARNING))},[l]),(0,i.jsx)(eo.Z,{elems:n,defineElementKey:function(e){return"SharedSlice"!==e.type?e.payload.key:e.payload.model.name},renderElem:function(e){if("SharedSlice"!==e.type){var n=e.payload;return(0,i.jsx)(eV,{slice:n,path:r})}var t=e.payload;return(0,i.jsx)(ed.b,{action:{type:"remove",onRemove:function(){a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})},sx:{padding:"16px"}})},eE=function(e,n){var t,i=(n||[]).reduce(function(e,n){return(0,L.Z)(e).concat((0,L.Z)(n.components))},[]),r=e.value.reduce(function(e,n){var t=n.key,r=n.value;if("SharedSlice"===r.type){var a=i.find(function(e){return e.model.id===t});return a?(0,f.Z)((0,u.Z)({},e),{slicesInSliceZone:(0,L.Z)(e.slicesInSliceZone).concat([{type:"SharedSlice",payload:a},])}):(0,f.Z)((0,u.Z)({},e),{notFound:(0,L.Z)(e.notFound).concat([{key:t}])})}return(0,f.Z)((0,u.Z)({},e),{slicesInSliceZone:(0,L.Z)(e.slicesInSliceZone).concat([{type:"Slice",payload:{key:t,value:r}},])})},{slicesInSliceZone:[],notFound:[]});return{availableSlices:i,slicesInSliceZone:r.slicesInSliceZone,notFound:r.notFound}},eF=function(e){var n,t=e.customType,a=e.onCreateSliceZone,l=e.onDeleteSliceZone,d=e.onRemoveSharedSlice,u=e.sliceZone,f=e.tabId,m=(0,s.useRouter)(),h=m.query,v=m.replace,p=m.pathname,x=(0,Q.QT)(en,[]),y=(0,c.useState)(!1),j=y[0],b=y[1],g=(0,c.useState)(!1),C=g[0],I=g[1],w=(0,c.useState)(!1),Z=w[0],T=w[1],k=(0,o.v9)(function(e){return{remoteSlices:(0,J.sT)(e),libraries:(0,J.Sd)(e),slices:(0,J.xC)(e)}}),z=k.remoteSlices,D=k.libraries,N=(0,S.G)().setCustomType,L=D.filter(function(e){return e.isLocal}),V=(0,c.useMemo)(function(){return u?eE(u,D):{availableSlices:[],slicesInSliceZone:[],notFound:[]}},[u,D]),M=V.availableSlices,E=V.slicesInSliceZone,F=V.notFound,H=(0,c.useState)(!1),O=H[0],R=H[1];(0,c.useEffect)(function(){(null==F?void 0:F.length)&&F.forEach(function(e){d(e.key)})},[F]);var X=E.filter(function(e){return"SharedSlice"===e.type}).map(function(e){return e.payload}),G=M.filter(function(e){return!X.some(function(n){return n.model.id===e.model.id})}),Y=function(){I(!0)},W=function(){T(!0)},$=function(){b(!0),P.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:t.id,customTypeFormat:t.format})},ee=function(){"true"===h.newPageType&&v({pathname:p,query:{pageTypeId:h.pageTypeId}},void 0,{shallow:!0})},et=function(){I(!1)},ea=function(){T(!1)},el=function(){b(!1)};return(0,i.jsxs)(i.Fragment,{children:[void 0===h.newPageType?(0,i.jsx)(A.Bu,{actions:u?(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{color:"grey",startIcon:"add",children:"Add slices"})}),(0,i.jsxs)(r.AW,{align:"end",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"add",size:"large"}),onSelect:W,description:"Start from scratch.",children:"Create new"}),x.length>0?(0,i.jsx)(r.Xi,{onSelect:$,startIcon:(0,i.jsx)(r.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",shortcut:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,G.length>0?(0,i.jsx)(r.Xi,{onSelect:Y,startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==t.format||"Main"!==f?(0,i.jsx)(r.rs,{checked:!!u,onCheckedChange:function(e){e?a():R(!0)},size:"small","data-cy":"slice-zone-switch"}):void 0,children:"Slice Zone"}):void 0,u?E.length>0?(0,i.jsx)(K.xR,{children:(0,i.jsx)(eM,{slices:E,format:t.format,path:{customTypeID:t.id,tabID:f,sliceZoneID:null!==(n=null==u?void 0:u.key)&&void 0!==n?n:""},onRemoveSharedSlice:d})}):(0,i.jsx)(q,{openUpdateSliceZoneModal:Y,openCreateSliceModal:W,openSlicesTemplatesModal:$,projectHasAvailableSlices:G.length>0,isSlicesTemplatesSupported:x.length>0}):void 0,C&&(0,i.jsx)(ef,{formId:"tab-slicezone-form-".concat(f),availableSlices:G,onSubmit:function(e){var n=ei({customType:t,tabId:f,slices:e});N(_.Dc.fromSM(n)),et(),ee(),U.Am.success("Slice(s) added to slice zone")},close:et}),j&&(0,i.jsx)(ey,{formId:"tab-slicezone-form-".concat(f),availableSlicesTemplates:x,localLibraries:L,onSuccess:function(e){var n=ei({customType:t,tabId:f,slices:e});N(_.Dc.fromSM(n)),el(),ee(),U.Am.success((0,i.jsx)(er.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},close:el}),O&&(0,i.jsx)(ec,{closeDeleteSliceZoneModal:function(){R(!1)},deleteSliceZone:function(){l(),R(!1)}}),(null==L?void 0:L.length)!==0&&Z&&(0,i.jsx)(B.c,{onSuccess:function(e){var n=ei({customType:t,tabId:f,slices:[e]});N(_.Dc.fromSM(n)),ea(),ee(),U.Am.success((0,i.jsx)(er.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},localLibraries:L,remoteSlices:z,onClose:ea})]})},eA=function(e){var n,t,a,l=e.tabId,o=(0,S.G)(),d=o.customType,u=o.setCustomType,f=_.Dc.toSM(d),m=null===(n=f.tabs.find(function(e){return e.key===l}))||void 0===n?void 0:n.sliceZone,h=null!==(a=null===(t=f.tabs.find(function(e){return e.key===l}))||void 0===t?void 0:t.value)&&void 0!==a?a:[],v=(0,s.useRouter)().query,p=f.tabs.reduce(function(e,n){return(0,L.Z)(e).concat((0,L.Z)(n.value))},[]),x=function(e){var n=(0,I.AK)({customType:d,fieldId:e,sectionId:l});u(n)},y=function(e){var n=e.id,t=e.label,i=e.widgetTypeName;if(!(0,F.Ss)(M,i)){var r=M[i],a=r.create(t);if("Range"===a.type||"IntegrationFields"===a.type||"Separator"===a.type)throw Error("Unsupported Field Type: ".concat(a.type));var s=M[a.type];try{s.schema.validateSync(a,{stripUnknown:!1})}catch(c){throw Error('Add field: Model is invalid for field "'.concat(a.type,'".'))}var o=_.L$.fromSM(a),f=(0,I.xS)({customType:d,newField:o,newFieldId:n,sectionId:l});u(f),P.Xe.track({event:"custom-type:field-added",id:n,name:d.id,type:r.TYPE_NAME,zone:"static"})}},j=function(e){if(!(0,F.uS)(e)){var n=e.source,t=e.destination;if(t){var i=(0,I.gR)({customType:d,sourceIndex:n.index,destinationIndex:t.index,sectionId:l});(0,V.flushSync)(function(){return u(i)})}}},b=function(e){var n=e.apiId,t=e.newKey,i=e.value;if(!(0,F.Ss)(M,i.type)){var r=_.L$.fromSM(i),a=(0,I.L4)({customType:d,previousFieldId:n,newFieldId:t,newField:r,sectionId:l});u(a)}},g=function(){var e=(0,I.Tr)(d,l);u(e)},C=function(){var e=(0,I.E3)(d,l);u(e)},w=function(e){var n=(0,I.EN)({customType:d,sectionId:l,sliceId:e});u(n)};return(0,i.jsx)(r.SV,{children:(0,i.jsx)(c.Suspense,{fallback:(0,i.jsx)(r.xu,{padding:32,children:(0,i.jsx)(r._3,{})}),children:(0,i.jsxs)(A.aV,{style:{flexGrow:1},children:[void 0===v.newPageType?(0,i.jsx)(R.Z,{zoneType:"customType",tabId:l,title:"Static Zone",dataTip:"",fields:h,poolOfFieldsToCheck:p,showHints:!0,EditModal:O.Z,widgetsArray:E,onDeleteItem:x,onSave:b,onSaveNewField:y,onDragEnd:j,renderHintBase:function(e){var n=e.item;return"data".concat((0,H.Ti)(n.key))},renderFieldAccessor:function(e){return"data".concat((0,H.Ti)(e))},dataCy:"static-zone-content",isRepeatableCustomType:d.repeatable}):void 0,(0,i.jsx)(eF,{customType:f,tabId:l,sliceZone:m,onRemoveSharedSlice:w,onCreateSliceZone:g,onDeleteSliceZone:C})]})})})},eP=function(){var e,n,t,a=(0,S.G)(),l=a.customType,o=a.setCustomType,d=_.Dc.toSM(l),u=(0,c.useState)(null===(e=d.tabs[0])||void 0===e?void 0:e.key),f=u[0],m=u[1],h=(0,c.useState)(),v=h[0],p=h[1],w=(0,s.useRouter)().query,Z=(null===(n=d.tabs.find(function(e){return e.key===f}))||void 0===n?void 0:null===(t=n.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(x,{style:Z?{flexGrow:1}:void 0,children:["page"===l.format?(0,i.jsx)(y,{}):void 0,"true"===w.newPageType?(0,i.jsx)(eA,{tabId:d.tabs[0].key}):(0,i.jsxs)(j,{onValueChange:m,value:f,children:[(0,i.jsx)(b,{onAddNewTab:function(){p({type:"CREATE_CUSTOM_TYPE_TAB"})},children:d.tabs.map(function(e){return(0,i.jsx)(g,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Xi,{onSelect:function(){p({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(r.Xi,{color:"tomato",disabled:d.tabs.length<=1,onSelect:function(){p({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key)})}),d.tabs.map(function(e){return(0,i.jsx)(C,{value:e.key,children:(0,i.jsx)(eA,{tabId:e.key})},e.key)})]})]}),(null==v?void 0:v.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(z,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;o((0,I.vB)(l,n)),m(n)},tabIds:d.tabs.map(function(e){return e.key.toLowerCase()})}):void 0,(null==v?void 0:v.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(N,{close:function(){p(void 0)},initialTabKey:v.tabKey,isOpen:!0,onSubmit:function(e){var n=e.id;o((0,I.HO)(l,v.tabKey,n)),f===v.tabKey&&m(n)},tabIds:d.tabs.filter(function(e){return e.key!==v.tabKey}).map(function(e){return e.key.toLowerCase()})}):void 0,(null==v?void 0:v.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(D,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(){if(o((0,I.F$)(l,v.tabKey)),f===v.tabKey){var e,n=null===(e=d.tabs.find(function(e){return e.key!==v.tabKey}))||void 0===e?void 0:e.key;void 0!==n&&m(n)}}}):void 0]})},eH=t(7819),eO=t(67445),eR=t(49471),eK=t(47976),eU=t(19345);t(5608);var eB=function(e){var n=e.tabs,t=(0,m.Z)(e,["tabs"]);return(0,i.jsxs)(v.fC,(0,f.Z)((0,u.Z)({},t),{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97dm _1ecs97d7z _1ecs97df7d",defaultValue:n[0].label,orientation:"vertical",children:[(0,i.jsx)(v.aV,{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97d6qm _1ecs97d6xz _1ecs97df29 _1ecs97df2l _1ecs97dfhl","aria-label":"content tabs",children:n.map(function(e,n){var t=e.label;return(0,i.jsx)(v.xz,{className:"_76k20u4 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97da62 _1ecs97dadf _1ecs97df41 _1ecs97dfg6",value:t,children:(0,i.jsx)(r.xv,{className:"_76k20u5",component:"span",color:"inherit",children:t})},"".concat(t,"-trig").concat(n+1))})}),n.map(function(e,n){var t=e.label,a=e.content;return(0,i.jsx)(v.VY,{className:"_76k20u6 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97df7d _1ecs97df2s",value:t,children:(0,i.jsx)(r.xr,{className:"_1ecs97dfft",children:a})},"".concat(t,"-content").concat(n+1))})]}))},eX=t(88241),eG=t(70863),eq=t(8857),eJ=t(49109),eY=t(72757),eW=t(25145),e$=function(){return(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1707 19.1237C17.9629 19.3056 17.9419 19.6214 18.1237 19.8293C18.3056 20.0371 18.6214 20.0581 18.8293 19.8763L22.8293 16.3763C22.9378 16.2814 23 16.1442 23 16C23 15.8558 22.9378 15.7187 22.8293 15.6237L18.8293 12.1237C18.6214 11.9419 18.3056 11.9629 18.1237 12.1708C17.9419 12.3786 17.9629 12.6945 18.1707 12.8763L21.7407 16L18.1707 19.1237ZM13.8293 12.8763C14.0371 12.6945 14.0581 12.3786 13.8763 12.1708C13.6944 11.9629 13.3786 11.9419 13.1707 12.1237L9.17075 15.6237C9.06224 15.7187 9 15.8558 9 16C9 16.1442 9.06224 16.2814 9.17075 16.3763L13.1707 19.8763C13.3786 20.0581 13.6944 20.0371 13.8763 19.8293C14.0581 19.6214 14.0371 19.3056 13.8293 19.1237L10.2593 16L13.8293 12.8763Z",fill:"#6F6E77"})})},eQ=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{d:"M21.2388 10H10.7623C10.3415 10 10 10.3415 10 10.7623V21.2377C10 21.6585 10.3415 22 10.7623 22H21.2377C21.6585 22 22 21.6585 22 21.2388V10.7623C22 10.3415 21.6585 10 21.2388 10ZM16.5714 19.1953C16.5714 20.3371 15.9018 20.8571 14.9241 20.8571C14.0402 20.8571 13.4029 20.2645 13.1429 19.7143L14.0413 19.1708C14.2143 19.4777 14.4777 19.7143 14.8571 19.7143C15.2199 19.7143 15.4286 19.5725 15.4286 19.0212V15.4286H16.5714V19.1953ZM19.0502 20.8571C18.0379 20.8571 17.4632 20.3471 17.1429 19.7143L18 19.1429C18.2333 19.5246 18.4877 19.8895 19.0257 19.8895C19.4777 19.8895 19.7143 19.6641 19.7143 19.3516C19.7143 18.9788 19.4688 18.846 18.9721 18.6283L18.6998 18.5112C17.9129 18.1763 17.3895 17.7567 17.3895 16.8683C17.3895 16.0513 18.0134 15.4286 18.9866 15.4286C19.6797 15.4286 20.1775 15.6696 20.5368 16.3013L19.6886 16.8471C19.5011 16.5112 19.3002 16.3795 18.9866 16.3795C18.6674 16.3795 18.4654 16.5826 18.4654 16.8471C18.4654 17.1741 18.6674 17.3058 19.135 17.5089L19.4074 17.6261C20.3348 18.0223 20.8571 18.4275 20.8571 19.3382C20.8571 20.3192 20.0859 20.8571 19.0502 20.8571Z",fill:"#6F6E77"})})},e0=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.1719 10H20.8281C21.4753 10 22 10.5247 22 11.1719V20.8281C22 21.4753 21.4753 22 20.8281 22H11.1719C10.5247 22 10 21.4753 10 20.8281V11.1719C10 10.5247 10.5247 10 11.1719 10ZM17.4283 20.7223V19.549C17.641 19.7275 17.8721 19.8613 18.1215 19.9505C18.371 20.0397 18.6228 20.0843 18.8771 20.0843C19.0263 20.0843 19.1565 20.0709 19.2678 20.044C19.3791 20.0171 19.472 19.9798 19.5466 19.9322C19.6211 19.8845 19.6768 19.8283 19.7135 19.7635C19.7501 19.6987 19.7685 19.6285 19.7685 19.5527C19.7685 19.45 19.7391 19.3583 19.6805 19.2777C19.6217 19.197 19.5417 19.1225 19.4402 19.054C19.3387 18.9856 19.2183 18.9196 19.0789 18.856C18.9395 18.7925 18.7891 18.7277 18.6277 18.6617C18.2169 18.4906 17.9106 18.2816 17.7089 18.0347C17.5071 17.7878 17.4062 17.4896 17.4062 17.1401C17.4062 16.8663 17.4613 16.631 17.5713 16.4343C17.6814 16.2375 17.8311 16.0756 18.0206 15.9484C18.2102 15.8213 18.4296 15.7278 18.6791 15.668C18.9285 15.6081 19.1926 15.5781 19.4714 15.5781C19.7452 15.5781 19.988 15.5946 20.1995 15.6276C20.411 15.6606 20.606 15.7113 20.7845 15.7798V16.8761C20.6965 16.815 20.6005 16.7612 20.4966 16.7148C20.3927 16.6683 20.2857 16.6298 20.1756 16.5992C20.0656 16.5687 19.9562 16.5461 19.8473 16.5314C19.7385 16.5168 19.6352 16.5094 19.5374 16.5094C19.4029 16.5094 19.2806 16.5223 19.1706 16.5479C19.0605 16.5736 18.9676 16.6097 18.8918 16.6561C18.816 16.7025 18.7573 16.7581 18.7157 16.8229C18.6742 16.8877 18.6534 16.9604 18.6534 17.0411C18.6534 17.1291 18.6766 17.2079 18.7231 17.2776C18.7695 17.3472 18.8356 17.4132 18.9212 17.4756C19.0068 17.5379 19.1107 17.599 19.2329 17.6589C19.3552 17.7188 19.4934 17.7805 19.6474 17.8441C19.8577 17.932 20.0466 18.0255 20.2142 18.1245C20.3817 18.2235 20.5253 18.3354 20.6451 18.46C20.765 18.5847 20.8567 18.7271 20.9203 18.8872C20.9838 19.0473 21.0156 19.2337 21.0156 19.4463C21.0156 19.7397 20.96 19.9859 20.8487 20.1851C20.7375 20.3844 20.5865 20.5457 20.3957 20.6691C20.205 20.7926 19.9831 20.8812 19.73 20.935C19.4769 20.9887 19.2097 21.0156 18.9285 21.0156C18.6399 21.0156 18.3655 20.9912 18.105 20.9423C17.8446 20.8934 17.619 20.8201 17.4283 20.7223ZM16.9609 16.6582H15.4558V20.9453H14.2634V16.6582H12.7656V15.6953H16.9609V16.6582Z",fill:"#6F6E77"})})},e1=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.031 11L15.7584 17.8336L16.0831 18.4288L16.4077 17.8336L20.1352 11H22L16.0831 21.4347L10 11H12.031ZM19.2924 11.0006L16.0831 16.8843L12.8737 11.0005L14.2612 11.0001L14.727 11L15.2777 11.9497L16.1319 13.4226L16.9886 11.9512L17.542 11.0006H17.9881H19.2924Z",fill:"#6F6E77"})})},e7=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,children:(0,i.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,i.jsx)("path",{d:"M0 0h32v32H0z"}),(0,i.jsx)("path",{fill:"#6F6E77",fillRule:"nonzero",d:"M15.45 10.534c1.592-1.013 3.794-.542 4.908 1.054.533.747.742 1.679.585 2.584a3.2 3.2 0 0 1-.48 1.197c.35.664.466 1.427.333 2.167a3.205 3.205 0 0 1-1.449 2.148l-2.795 1.782c-1.593 1.013-3.792.542-4.908-1.054a3.413 3.413 0 0 1-.585-2.584c.075-.425.24-.834.48-1.197a3.374 3.374 0 0 1-.334-2.167 3.205 3.205 0 0 1 1.449-2.148Zm3.756 1.785a2.224 2.224 0 0 0-2.383-.883 2.053 2.053 0 0 0-.57.249l-2.794 1.782c-.46.29-.778.759-.873 1.292a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.203-.054.393-.138.569-.249l1.064-.68a.567.567 0 0 1 .171-.076.67.67 0 0 1 .718.266.613.613 0 0 1 .106.468.582.582 0 0 1-.263.39L14.89 19.1a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.612.612 0 0 1-.114-.414l.011-.103-.103-.033a3.608 3.608 0 0 1-1.094-.547l-.144-.106-.051.16c-.03.084-.052.17-.068.26a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.2-.054.393-.138.569-.249l2.795-1.782c.46-.29.777-.759.872-1.292a2.06 2.06 0 0 0-.352-1.555 2.224 2.224 0 0 0-2.384-.883 2.053 2.053 0 0 0-.568.249l-1.065.68a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.613.613 0 0 1-.106-.468.582.582 0 0 1 .263-.39l2.795-1.783a.567.567 0 0 1 .17-.076.67.67 0 0 1 .719.266c.086.119.127.268.113.414l-.01.103.102.033c.393.119.764.303 1.095.547l.143.106.052-.16c.03-.084.051-.17.068-.26a2.06 2.06 0 0 0-.353-1.555Z"})]})})};t(69001),eq.Z.registerLanguage("tsx",eJ.Z),eq.Z.registerLanguage("markup",eY.Z),eq.Z.alias("markup","vue"),eq.Z.alias("markup","svelte");var e2=function(e){var n,t=(null!==(n=e.fileName.match(/\.([^\.]*)$/))&&void 0!==n?n:[])[1];return function(){switch(t){case"ts":case"tsx":return(0,i.jsx)(e0,{});case"js":case"jsx":return(0,i.jsx)(eQ,{});case"vue":return(0,i.jsx)(e1,{});case"svelte":return(0,i.jsx)(e7,{});default:return(0,i.jsx)(e$,{})}}()},e9=function(e){var n=e.code,t=e.onCopy,a=(0,c.useState)(!1),l=a[0],s=a[1];(0,c.useEffect)(function(){if(l){var e=setTimeout(function(){s(!1)},1200);return function(){clearTimeout(e)}}},[l]);var o=function(){navigator.clipboard.writeText(n).then(function(){s(!0),void 0!==t&&t()})};return(0,i.jsx)(r.hU,{size:"small",onClick:o,icon:l?"check":"contentCopy",hiddenLabel:l?"Code successfully copied":"Copy code"})},e4=function(e){var n=e.fileInfo,t=e.className,a=e.copy,l=e.code,s=e.onCopy,c=/language-(\w+)/.exec(null!=t?t:"");return(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez5 _1ecs97df2h _1ecs97df0r _1ecs97df23 _1ecs97d3fg _1ecs97d3mt",children:[(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dezi _1ecs97df1k _1ecs97df1u _1ecs97df29 _1ecs97df2l _1ecs97d18 _1ecs97d8l _1ecs97d6r8 _1ecs97d6yl _1ecs97dfg4 _1ecs97dfic",children:[void 0!==n?(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezi _1ecs97dez8",children:[(0,i.jsx)(e2,{fileName:n.fileName}),(0,i.jsx)(r.xv,{className:"_8uty130",color:"grey11",children:n.fileName})]}):(0,i.jsx)("span",{}),!0===a?(0,i.jsx)(e9,{onCopy:s,code:String(l)}):null]}),null!==c&&c[1]?(0,i.jsx)(eq.Z,{showLineNumbers:!0,customStyle:{margin:0,border:"none",fontSize:"12px",lineHeight:"18px",borderRadius:"none",backgroundColor:"#FFF",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"},children:String(l).replace(/\n$/,""),style:eW.MS,language:c[1],PreTag:"div"}):l]})},e8="_1ecs97dfh5",e6=t(36065),e3=function(e){var n=(0,e6.p)();if(!0===e.inline)return(0,i.jsx)("code",(0,f.Z)((0,u.Z)({},e),{className:"_1ecs97df46 _1ecs97d18 _1ecs97d8l _1ecs97df0r _1ecs97dfg3 _1ecs97dfhg"}));var t=function(){var n,t;if((null===(n=e.node)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.meta)!==void 0){var i,r,a,l=null===(i=e.node)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.meta;return{fileName:l.substring(1,l.length-1),language:null===(a=e.className)||void 0===a?void 0:a.split("-")[1]}}return null}(),r=function(){void 0!==n&&P.Xe.track({event:"page-type:copy-snippet",framework:n})};return(0,i.jsx)(e4,(0,u.Z)((0,f.Z)((0,u.Z)({copy:!0},e),{onCopy:r,code:e.children}),null!==t?{fileInfo:t}:{}))},e5=function(e){var n=e.markdown;return(0,i.jsx)(eG.D,{children:n,linkTarget:"_blank",remarkPlugins:[eX.Z],components:{code:function(e){return(0,i.jsx)(e3,(0,u.Z)({},e))},h1:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h1",variant:"h1"})},h2:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h2",variant:"h2"})},h3:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h3",variant:"h3"})},h4:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},h5:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},p:function(e){return(0,i.jsx)(r.xv,{className:e8,children:e.children,component:"p",variant:"normal"})},pre:function(e){return(0,i.jsx)(r.xv,{className:e8,children:e.children,component:"pre",variant:"normal"})}}})};function ne(e){return nn.apply(this,arguments)}function nn(){return(nn=(0,Y.Z)(function(e){var n,t,i,r;return(0,$.__generator)(this,function(a){switch(a.label){case 0:return n=JSON.parse(e),[4,ee.j.documentation.read({kind:n.kind,data:n.data})];case 1:if(i=(t=a.sent()).errors,r=t.documentation,i.length>0)throw i;return[2,r]}})})).apply(this,arguments)}t(75317);var nt=function(e){var n,t=e.model,a=(0,e6.p)(),l=(0,Q.QT)(ne,[JSON.stringify({kind:"PageSnippet",data:{model:t}})]);if(0===l.length)return null;var s=function(){void 0!==a&&P.Xe.track({event:"page-type:open-snippet",framework:a})};return(0,i.jsxs)(r.Vq,{size:"small",trigger:(0,i.jsx)(r.zx,{color:"grey",onClick:s,startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(r.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:"_3uvawd0 _1ecs97dez2 _1ecs97dezb _1ecs97df7d _1ecs97df94",children:l.length>1?(0,i.jsx)(eB,{style:{flex:1},tabs:l.map(function(e,n){var t=e.label,r=e.content;return{label:null!=t?t:"Tab ".concat(n+1),content:(0,i.jsx)(e5,{markdown:r})}})}):(0,i.jsx)(r.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(e5,{markdown:l[0].content})})})]})},ni=function(e){var n=e.model;return(0,i.jsx)("div",{children:(0,i.jsx)(r.SV,{children:(0,i.jsx)(c.Suspense,{fallback:(0,i.jsx)(r.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(nt,{model:n})})})})},nr=function(){var e=(0,s.useRouter)(),n=(0,o.v9)(function(n){return{selectedCustomType:(0,eR.Jk)(n,(0,eO.Ag)(e.query))}}).selectedCustomType;return((0,c.useEffect)(function(){n&&(0,eH.TG)(n)||e.replace("/")},[n,e]),n&&(0,eH.TG)(n))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsxs)("title",{children:[n.local.label," - Slice Machine"]})}),(0,i.jsx)(na,{customType:n.local})]}):(0,i.jsx)(d.LN,{})},na=function(e){var n=e.customType;return null===n?(0,i.jsx)(d.LN,{}):(0,i.jsx)(d.LN,{children:(0,i.jsx)(S.k,{initialCustomType:_.Dc.fromSM(n),children:function(e){var t,a=e.autoSaveStatus,l=e.customType,s=e.setCustomType,c=(0,I.y6)(l),o=eO.cd[n.format],u=eb.$[n.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.wd,{children:[(0,i.jsx)(d.Xq,{url:o.tablePagePathname}),(0,i.jsx)(d.Cx,{folder:u.name({start:!0,plural:!0}),page:null!==(t=l.label)&&void 0!==t?t:l.id}),(0,i.jsxs)(d.K2,{children:[(0,i.jsx)(eK.X,{status:a}),"page"===l.format?(0,i.jsx)(ni,{model:l}):void 0,(0,i.jsx)(eU._,{isChangesLocal:!0,format:c,customType:l,setLocalCustomType:s})]})]}),(0,i.jsx)(d.RN,{children:(0,i.jsx)(r.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eP,{})})})]})}})})}},65988:function(e,n,t){"use strict";t.d(n,{E:function(){return f}});var i=t(22710),r=t(62230),a=t(85244),l=t(17064),s=t(99267),c=t(17329),o=t(81038);function d(){return u.apply(this,arguments)}function u(){return(u=(0,i.Z)(function(){return(0,s.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}function f(e){var n,t,u,f,m,h,v=(0,l.Z)((n=(0,c.QT)(d,[]),t=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,c.VA)(d,[],e),[2]}})}),[n,u=function(e){return t.apply(this,arguments)}]),2),p=v[0],x=v[1],y=(h=(0,i.Z)(function(n){var t;return(0,s.__generator)(this,function(i){switch(i.label){case 0:return t=(0,a.Z)((0,r.Z)({},p),{labs:(0,r.Z)({},p.labs)}),n?t.labs[e]=n:e in t.labs&&delete t.labs[e],0===Object.keys(t.labs).length&&delete t.labs,[4,x(t)];case 1:return i.sent(),[2]}})}),function(e){return h.apply(this,arguments)});return[{enabled:null!==(m=null==p?void 0:null===(f=p.labs)||void 0===f?void 0:f[e])&&void 0!==m&&m},y]}},69001:function(){},5608:function(){},75317:function(){}}]);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/ !function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var c in n)o.call(n,c)&&n[c]&&e.push(c)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0!==(n=(function(){return r}).apply(t,[]))&&(e.exports=n)}()},79797:function(e,t,n){"use strict";n.d(t,{Z:function(){return eo}});var o,r=n(7896),a=n(59740),i=n(9249),c=n(87371),l=n(45754),s=n(4309),u=n(80753),d=n(56666),f=n(86522),p=n(2784),m=function(e){return+setTimeout(e,16)},v=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(m=function(e){return window.requestAnimationFrame(e)},v=function(e){return window.cancelAnimationFrame(e)});var h=0,y=new Map;function E(e){y.delete(e)}var g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return h+=1,!function t(n){if(0===n)E(h),e();else{var o=m(function(){t(n-1)});y.set(h,o)}}(t),h};g.cancel=function(e){var t=y.get(e);return E(t),v(t)};var C=n(28316);function w(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}var k=(0,p.forwardRef)(function(e,t){var n=e.didUpdate,o=e.getContainer,r=e.children,a=(0,p.useRef)(),i=(0,p.useRef)();(0,p.useImperativeHandle)(t,function(){return{}});var c=(0,p.useRef)(!1);return!c.current&&w()&&(i.current=o(),a.current=i.current.parentNode,c.current=!0),(0,p.useEffect)(function(){null==n||n(e)}),(0,p.useEffect)(function(){return null===i.current.parentNode&&null!==a.current&&a.current.appendChild(i.current),function(){var e,t;null===(e=i.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(i.current)}},[]),i.current?C.createPortal(r,i.current):null});function N(e){if("undefined"==typeof document)return 0;if(e||void 0===o){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var a=t.offsetWidth;n.style.overflow="scroll";var i=t.offsetWidth;a===i&&(i=n.clientWidth),document.body.removeChild(n),o=a-i}return o}var b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{};var n=t.element,o=void 0===n?document.body:n,r={},a=Object.keys(e);return a.forEach(function(e){r[e]=o.style[e]}),a.forEach(function(t){o.style[t]=e[t]}),r},S={},T=function(e){if(document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth||e){var t="ant-scrolling-effect",n=RegExp("".concat(t),"g"),o=document.body.className;if(e){if(!n.test(o))return;b(S),S={},document.body.className=o.replace(n,"").trim();return}var r=N();if(r&&(S=b({position:"relative",width:"calc(100% - ".concat(r,"px)")}),!n.test(o))){var a="".concat(o," ").concat(t);document.body.className=a.trim()}}},L=n(51171),A=0,M=[],O="ant-scrolling-effect",Z=RegExp("".concat(O),"g"),R=new Map,D=(0,c.Z)(function e(t){var n=this;(0,i.Z)(this,e),(0,d.Z)(this,"lockTarget",void 0),(0,d.Z)(this,"options",void 0),(0,d.Z)(this,"getContainer",function(){var e;return null===(e=n.options)||void 0===e?void 0:e.container}),(0,d.Z)(this,"reLock",function(e){var t=M.find(function(e){return e.target===n.lockTarget});t&&n.unLock(),n.options=e,t&&(t.options=e,n.lock())}),(0,d.Z)(this,"lock",function(){if(!M.some(function(e){return e.target===n.lockTarget})){if(M.some(function(e){var t,o=e.options;return(null==o?void 0:o.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})){M=[].concat((0,L.Z)(M),[{target:n.lockTarget,options:n.options}]);return}var e,t=0,o=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body;(o===document.body&&window.innerWidth-document.documentElement.clientWidth>0||o.scrollHeight>o.clientHeight)&&"hidden"!==getComputedStyle(o).overflow&&(t=N());var r=o.className;if(0===M.filter(function(e){var t,o=e.options;return(null==o?void 0:o.container)===(null===(t=n.options)||void 0===t?void 0:t.container)}).length&&R.set(o,b({width:0!==t?"calc(100% - ".concat(t,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:o})),!Z.test(r)){var a="".concat(r," ").concat(O);o.className=a.trim()}M=[].concat((0,L.Z)(M),[{target:n.lockTarget,options:n.options}])}}),(0,d.Z)(this,"unLock",function(){var e,t=M.find(function(e){return e.target===n.lockTarget});if(M=M.filter(function(e){return e.target!==n.lockTarget}),!(!t||M.some(function(e){var n,o=e.options;return(null==o?void 0:o.container)===(null===(n=t.options)||void 0===n?void 0:n.container)}))){var o=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body,r=o.className;Z.test(r)&&(b(R.get(o),{element:o}),R.delete(o),o.className=o.className.replace(Z,"").trim())}}),this.lockTarget=A++,this.options=t}),_=0,P=w(),I={},U=function(e){if(!P)return null;if(e){if("string"==typeof e)return document.querySelectorAll(e)[0];if("function"==typeof e)return e();if("object"===(0,f.Z)(e)&&e instanceof window.HTMLElement)return e}return document.body},H=function(e){(0,l.Z)(n,e);var t=(0,s.Z)(n);function n(e){var o;return(0,i.Z)(this,n),o=t.call(this,e),(0,d.Z)((0,u.Z)(o),"container",void 0),(0,d.Z)((0,u.Z)(o),"componentRef",p.createRef()),(0,d.Z)((0,u.Z)(o),"rafId",void 0),(0,d.Z)((0,u.Z)(o),"scrollLocker",void 0),(0,d.Z)((0,u.Z)(o),"renderComponent",void 0),(0,d.Z)((0,u.Z)(o),"updateScrollLocker",function(e){var t=(e||{}).visible,n=o.props,r=n.getContainer,a=n.visible;a&&a!==t&&P&&U(r)!==o.scrollLocker.getContainer()&&o.scrollLocker.reLock({container:U(r)})}),(0,d.Z)((0,u.Z)(o),"updateOpenCount",function(e){var t=e||{},n=t.visible,r=t.getContainer,a=o.props,i=a.visible,c=a.getContainer;i!==n&&P&&U(c)===document.body&&(i&&!n?_+=1:e&&(_-=1)),("function"==typeof c&&"function"==typeof r?c.toString()!==r.toString():c!==r)&&o.removeCurrentContainer()}),(0,d.Z)((0,u.Z)(o),"attachToParent",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.container&&!o.container.parentNode){var t=U(o.props.getContainer);return!!t&&(t.appendChild(o.container),!0)}return!0}),(0,d.Z)((0,u.Z)(o),"getContainer",function(){return P?(o.container||(o.container=document.createElement("div"),o.attachToParent(!0)),o.setWrapperClassName(),o.container):null}),(0,d.Z)((0,u.Z)(o),"setWrapperClassName",function(){var e=o.props.wrapperClassName;o.container&&e&&e!==o.container.className&&(o.container.className=e)}),(0,d.Z)((0,u.Z)(o),"removeCurrentContainer",function(){var e,t;null===(e=o.container)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(o.container)}),(0,d.Z)((0,u.Z)(o),"switchScrollingEffect",function(){1!==_||Object.keys(I).length?_||(b(I),I={},T(!0)):(T(),I=b({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}))}),o.scrollLocker=new D({container:U(e.getContainer)}),o}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e=this;this.updateOpenCount(),this.attachToParent()||(this.rafId=g(function(){e.forceUpdate()}))}},{key:"componentDidUpdate",value:function(e){this.updateOpenCount(e),this.updateScrollLocker(e),this.setWrapperClassName(),this.attachToParent()}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visible,n=e.getContainer;P&&U(n)===document.body&&(_=t&&_?_-1:_),this.removeCurrentContainer(),g.cancel(this.rafId)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.forceRender,o=e.visible,r=null,a={getOpenCount:function(){return _},getContainer:this.getContainer,switchScrollingEffect:this.switchScrollingEffect,scrollLocker:this.scrollLocker};return(n||o||this.componentRef.current)&&(r=p.createElement(k,{getContainer:this.getContainer,ref:this.componentRef},t(a))),r}}]),n}(p.Component),F=n(33028),K=n(72779),W=n.n(K),x={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=x.F1&&t<=x.F12)return!1;switch(t){case x.ALT:case x.CAPS_LOCK:case x.CONTEXT_MENU:case x.CTRL:case x.DOWN:case x.END:case x.ESC:case x.HOME:case x.INSERT:case x.LEFT:case x.MAC_FF_META:case x.META:case x.NUMLOCK:case x.NUM_CENTER:case x.PAGE_DOWN:case x.PAGE_UP:case x.PAUSE:case x.PRINT_SCREEN:case x.RIGHT:case x.SHIFT:case x.UP:case x.WIN_KEY:case x.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=x.ZERO&&e<=x.NINE||e>=x.NUM_ZERO&&e<=x.NUM_MULTIPLY||e>=x.A&&e<=x.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case x.SPACE:case x.QUESTION_MARK:case x.NUM_PLUS:case x.NUM_MINUS:case x.NUM_PERIOD:case x.NUM_DIVISION:case x.SEMICOLON:case x.DASH:case x.EQUALS:case x.COMMA:case x.PERIOD:case x.SLASH:case x.APOSTROPHE:case x.SINGLE_QUOTE:case x.OPEN_SQUARE_BRACKET:case x.BACKSLASH:case x.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},j={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},B=Object.keys(j).filter(function(e){if("undefined"==typeof document)return!1;var t=document.getElementsByTagName("html")[0];return e in(t?t.style:{})})[0],X=j[B];function Y(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function V(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.attachEvent&&e.detachEvent("on".concat(t),n)}var G=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Q=!("undefined"!=typeof window&&window.document&&window.document.createElement),z=function e(t,n,o,r){if(!n||n===document||n instanceof Document)return!1;if(n===t.parentNode)return!0;var a=n.scrollHeight-n.clientHeight,i=n.scrollWidth-n.clientWidth,c=document.defaultView.getComputedStyle(n),l="auto"===c.overflowY||"scroll"===c.overflowY,s="auto"===c.overflowX||"scroll"===c.overflowX,u=a&&l,d=i&&s;return(Math.max(Math.abs(o),Math.abs(r))===Math.abs(r)&&(!u||!!u&&(n.scrollTop>=a&&r<0||n.scrollTop<=0&&r>0))||Math.max(Math.abs(o),Math.abs(r))===Math.abs(o)&&(!d||!!d&&(n.scrollLeft>=i&&o<0||n.scrollLeft<=0&&o>0)))&&e(t,n.parentNode,o,r)},q=["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","scrollLocker","contentWrapperStyle"],J={},$=function(e){(0,l.Z)(n,e);var t=(0,s.Z)(n);function n(e){var o;return(0,i.Z)(this,n),(o=t.call(this,e)).levelDom=void 0,o.dom=void 0,o.contentWrapper=void 0,o.contentDom=void 0,o.maskDom=void 0,o.handlerDom=void 0,o.drawerId=void 0,o.timeout=void 0,o.passive=void 0,o.startPos=void 0,o.domFocus=function(){o.dom&&o.dom.focus()},o.removeStartHandler=function(e){if(e.touches.length>1){o.startPos=null;return}o.startPos={x:e.touches[0].clientX,y:e.touches[0].clientY}},o.removeMoveHandler=function(e){if(!(e.changedTouches.length>1)&&o.startPos){var t=e.currentTarget,n=e.changedTouches[0].clientX-o.startPos.x,r=e.changedTouches[0].clientY-o.startPos.y;(t===o.maskDom||t===o.handlerDom||t===o.contentDom&&z(t,e.target,n,r))&&e.cancelable&&e.preventDefault()}},o.transitionEnd=function(e){var t=e.target;V(t,X,o.transitionEnd),t.style.transition=""},o.onKeyDown=function(e){if(e.keyCode===x.ESC){var t=o.props.onClose;e.stopPropagation(),t&&t(e)}},o.onWrapperTransitionEnd=function(e){var t=o.props,n=t.open,r=t.afterVisibleChange;e.target===o.contentWrapper&&e.propertyName.match(/transform$/)&&(o.dom.style.transition="",!n&&o.getCurrentDrawerSome()&&(document.body.style.overflowX="",o.maskDom&&(o.maskDom.style.left="",o.maskDom.style.width="")),r&&r(!!n))},o.openLevelTransition=function(){var e=o.props,t=e.open,n=e.width,r=e.height,a=o.getHorizontalBoolAndPlacementName(),i=a.isHorizontal,c=a.placementName,l=o.contentDom?o.contentDom.getBoundingClientRect()[i?"width":"height"]:0;o.setLevelAndScrolling(t,c,(i?n:r)||l)},o.setLevelTransform=function(e,t,n,r){var a=o.props,i=a.placement,c=a.levelMove,l=a.duration,s=a.ease,u=a.showMask;o.levelDom.forEach(function(a){a.style.transition="transform ".concat(l," ").concat(s),Y(a,X,o.transitionEnd);var d=e?n:0;if(c){var f,p,m,v=(f=c,p={target:a,open:e},m="function"==typeof f?f(p):f,Array.isArray(m)?2===m.length?m:[m[0],m[1]]:[m]);d=e?v[0]:v[1]||0}var h="number"==typeof d?"".concat(d,"px"):d,y="left"===i||"top"===i?h:"-".concat(h);y=u&&"right"===i&&r?"calc(".concat(y," + ").concat(r,"px)"):y,a.style.transform=d?"".concat(t,"(").concat(y,")"):""})},o.setLevelAndScrolling=function(e,t,n){var r=o.props.onChange;if(!Q){var a=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?N(!0):0;o.setLevelTransform(e,t,n,a),o.toggleScrollingToDrawerAndBody(a)}r&&r(e)},o.toggleScrollingToDrawerAndBody=function(e){var t=o.props,n=t.getContainer,r=t.showMask,a=t.open,i=n&&n();if(i&&i.parentNode===document.body&&r){var c=["touchstart"],l=[document.body,o.maskDom,o.handlerDom,o.contentDom];a&&"hidden"!==document.body.style.overflow?(e&&o.addScrollingEffect(e),document.body.style.touchAction="none",l.forEach(function(e,t){e&&Y(e,c[t]||"touchmove",t?o.removeMoveHandler:o.removeStartHandler,o.passive)})):o.getCurrentDrawerSome()&&(document.body.style.touchAction="",e&&o.remScrollingEffect(e),l.forEach(function(e,t){e&&V(e,c[t]||"touchmove",t?o.removeMoveHandler:o.removeStartHandler,o.passive)}))}},o.addScrollingEffect=function(e){var t=o.props,n=t.placement,r=t.duration,a=t.ease,i="width ".concat(r," ").concat(a),c="transform ".concat(r," ").concat(a);switch(o.dom.style.transition="none",n){case"right":o.dom.style.transform="translateX(-".concat(e,"px)");break;case"top":case"bottom":o.dom.style.width="calc(100% - ".concat(e,"px)"),o.dom.style.transform="translateZ(0)"}clearTimeout(o.timeout),o.timeout=setTimeout(function(){o.dom&&(o.dom.style.transition="".concat(c,",").concat(i),o.dom.style.width="",o.dom.style.transform="")})},o.remScrollingEffect=function(e){var t,n=o.props,r=n.placement,a=n.duration,i=n.ease;B&&(document.body.style.overflowX="hidden"),o.dom.style.transition="none";var c="width ".concat(a," ").concat(i),l="transform ".concat(a," ").concat(i);switch(r){case"left":o.dom.style.width="100%",c="width 0s ".concat(i," ").concat(a);break;case"right":o.dom.style.transform="translateX(".concat(e,"px)"),o.dom.style.width="100%",c="width 0s ".concat(i," ").concat(a),o.maskDom&&(o.maskDom.style.left="-".concat(e,"px"),o.maskDom.style.width="calc(100% + ".concat(e,"px)"));break;case"top":case"bottom":o.dom.style.width="calc(100% + ".concat(e,"px)"),o.dom.style.height="100%",o.dom.style.transform="translateZ(0)",t="height 0s ".concat(i," ").concat(a)}clearTimeout(o.timeout),o.timeout=setTimeout(function(){o.dom&&(o.dom.style.transition="".concat(l,",").concat(t?"".concat(t,","):"").concat(c),o.dom.style.transform="",o.dom.style.width="",o.dom.style.height="")})},o.getCurrentDrawerSome=function(){return!Object.keys(J).some(function(e){return J[e]})},o.getLevelDom=function(e){var t,n=e.level,r=e.getContainer;if(!Q){var a=r&&r(),i=a?a.parentNode:null;(o.levelDom=[],"all"===n)?(i?Array.prototype.slice.call(i.children):[]).forEach(function(e){"SCRIPT"!==e.nodeName&&"STYLE"!==e.nodeName&&"LINK"!==e.nodeName&&e!==a&&o.levelDom.push(e)}):n&&(Array.isArray(t=n)?t:[t]).forEach(function(e){document.querySelectorAll(e).forEach(function(e){o.levelDom.push(e)})})}},o.getHorizontalBoolAndPlacementName=function(){var e=o.props.placement,t="left"===e||"right"===e,n="translate".concat(t?"X":"Y");return{isHorizontal:t,placementName:n}},o.state={_self:(0,u.Z)(o)},o}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e,t=this;if(!Q){var n=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return n=!0,null}}))}catch(o){}this.passive=!!n&&{passive:!1}}var r=this.props,a=r.open,i=r.getContainer,c=r.showMask,l=r.autoFocus,s=i&&i();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(9*Math.random()).toString())).toString(16)),this.getLevelDom(this.props),a&&(s&&s.parentNode===document.body&&(J[this.drawerId]=a),this.openLevelTransition(),this.forceUpdate(function(){l&&t.domFocus()}),c&&(null===(e=this.props.scrollLocker)||void 0===e||e.lock()))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.open,o=t.getContainer,r=t.scrollLocker,a=t.showMask,i=t.autoFocus,c=o&&o();n!==e.open&&(c&&c.parentNode===document.body&&(J[this.drawerId]=!!n),this.openLevelTransition(),n?(i&&this.domFocus(),a&&(null==r||r.lock())):null==r||r.unLock())}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.open,n=e.scrollLocker;delete J[this.drawerId],t&&(this.setLevelTransform(!1),document.body.style.touchAction=""),null==n||n.unLock()}},{key:"render",value:function(){var e,t,n,o,i=this,c=this.props,l=c.className,s=c.children,u=c.style,f=c.width,m=c.height,v=(c.defaultOpen,c.open),h=c.prefixCls,y=c.placement,E=(c.level,c.levelMove,c.ease,c.duration,c.getContainer,c.handler),g=(c.onChange,c.afterVisibleChange,c.showMask),C=c.maskClosable,w=c.maskStyle,k=c.onClose,N=c.onHandleClick,b=c.keyboard,S=(c.getOpenCount,c.scrollLocker,c.contentWrapperStyle),T=(0,a.Z)(c,q),L=!!this.dom&&v,A=W()(h,(e={},(0,d.Z)(e,"".concat(h,"-").concat(y),!0),(0,d.Z)(e,"".concat(h,"-open"),L),(0,d.Z)(e,l||"",!!l),(0,d.Z)(e,"no-mask",!g),e)),M=this.getHorizontalBoolAndPlacementName().placementName,O=L?"":"".concat(M,"(").concat("left"===y||"top"===y?"-100%":"100%",")"),Z=E&&p.cloneElement(E,{onClick:function(e){E.props.onClick&&E.props.onClick(),N&&N(e)},ref:function(e){i.handlerDom=e}});return p.createElement("div",(0,r.Z)({},(n=["switchScrollingEffect","autoFocus"],o=(0,F.Z)({},T),Array.isArray(n)&&n.forEach(function(e){delete o[e]}),o),{tabIndex:-1,className:A,style:u,ref:function(e){i.dom=e},onKeyDown:L&&b?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),g&&p.createElement("div",{className:"".concat(h,"-mask"),onClick:C?k:void 0,style:w,ref:function(e){i.maskDom=e}}),p.createElement("div",{className:"".concat(h,"-content-wrapper"),style:(0,F.Z)({transform:O,msTransform:O,width:G(f)?"".concat(f,"px"):f,height:G(m)?"".concat(m,"px"):m},S),ref:function(e){i.contentWrapper=e}},p.createElement("div",{className:"".concat(h,"-content"),ref:function(e){i.contentDom=e}},s),Z))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,o=t._self;if(void 0!==n){var r=e.placement,a=e.level;r!==n.placement&&(o.contentDom=null),a!==n.level&&o.getLevelDom(e)}return{prevProps:e}}}]),n}(p.Component),ee=["defaultOpen","getContainer","wrapperClassName","forceRender","handler"],et=["visible","afterClose"],en=function(e){(0,l.Z)(n,e);var t=(0,s.Z)(n);function n(e){(0,i.Z)(this,n),(o=t.call(this,e)).dom=void 0,o.onHandleClick=function(e){var t=o.props,n=t.onHandleClick,r=t.open;if(n&&n(e),void 0===r){var a=o.state.open;o.setState({open:!a})}},o.onClose=function(e){var t=o.props,n=t.onClose,r=t.open;n&&n(e),void 0===r&&o.setState({open:!1})};var o,r=void 0!==e.open?e.open:!!e.defaultOpen;return o.state={open:r},"onMaskClick"in e&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),o}return(0,c.Z)(n,[{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultOpen,t.getContainer),o=t.wrapperClassName,i=t.forceRender,c=t.handler,l=(0,a.Z)(t,ee),s=this.state.open;return n?p.createElement(H,{visible:s,forceRender:!!c||i,getContainer:n,wrapperClassName:o},function(t){var n=t.visible,o=t.afterClose,i=(0,a.Z)(t,et);return p.createElement($,(0,r.Z)({},l,i,{open:void 0!==n?n:s,afterVisibleChange:void 0!==o?o:l.afterVisibleChange,handler:c,onClose:e.onClose,onHandleClick:e.onHandleClick}))}):p.createElement("div",{className:o,ref:function(t){e.dom=t}},p.createElement($,(0,r.Z)({},l,{open:s,handler:c,getContainer:function(){return e.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,o={prevProps:e};return void 0!==n&&e.open!==n.open&&(o.open=e.open),o}}]),n}(p.Component);en.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:p.createElement("div",{className:"drawer-handle"},p.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1,autoFocus:!0};var eo=en},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return C}});var o=n(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}n(52322);var a=["shift","alt","meta","mod","ctrl"],i={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function c(e){return(i[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function l(e,t){return void 0===t&&(t=","),e.split(t)}function s(e,t,n){void 0===t&&(t="+");var o,i=e.toLocaleLowerCase().split(t).map(function(e){return c(e)});return r({},{alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},{keys:i.filter(function(e){return!a.includes(e)}),description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([c(e.key),c(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&p([c(e.key),c(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var t=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var t;return!a.includes(e)&&u.delete(e.toLowerCase())}),t.forEach(function(e){return u.add(e.toLowerCase())})}function p(e){var t=Array.isArray(e)?e:[e];"meta"===e?u.clear():t.forEach(function(e){return u.delete(e.toLowerCase())})}function m(e,t){var n=e.target;void 0===t&&(t=!1);var o=n&&n.tagName;return d(t)?Boolean(o&&t&&t.some(function(e){return e.toLowerCase()===o.toLowerCase()})):Boolean(o&&t&&!0===t)}var v=function(e,t,n){void 0===n&&(n=!1);var o,r,a=t.alt,i=t.meta,l=t.mod,s=t.shift,f=t.ctrl,p=t.keys,m=e.key,v=e.code,h=e.ctrlKey,y=e.metaKey,E=e.shiftKey,g=e.altKey,C=c(v),w=m.toLowerCase();if(!n){if(!g===a&&"alt"!==w||!E===s&&"shift"!==w)return!1;if(l){if(!y&&!h)return!1}else if(!y===i&&"meta"!==w&&"os"!==w||!h===f&&"ctrl"!==w&&"control"!==w)return!1}return!!(p&&1===p.length&&(p.includes(w)||p.includes(C)))||(p?(void 0===r&&(r=","),(d(o=p)?o:o.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!p)},h=(0,o.createContext)(void 0),y=(0,o.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),E=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;function C(e,t,n,r){var a,i,u=(0,o.useRef)(null),C=(0,o.useRef)(!1),w=n instanceof Array?r instanceof Array?void 0:r:n,k=d(e)?e.join(null==w?void 0:w.splitKey):e,N=n instanceof Array?n:r instanceof Array?r:void 0,b=(0,o.useCallback)(t,null!=N?N:[]),S=(0,o.useRef)(b);N?S.current=b:S.current=t;var T=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(o,r){return o&&e(t[r],n[r])},!0):t===n}((i=(0,o.useRef)(void 0)).current,w)&&(i.current=w),i.current),L=(0,o.useContext)(y).enabledScopes,A=(0,o.useContext)(h);return g(function(){if((null==T?void 0:T.enabled)!==!1&&(e=L,t=null==T?void 0:T.scopes,0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!t||e.some(function(e){return t.includes(e)})||e.includes("*")))){var e,t,n=function(e,t){var n,o;if(void 0===t&&(t=!1),!(m(e,["input","textarea","select"])&&!m(e,null==T?void 0:T.enableOnFormTags)||null!=T&&null!=T.ignoreEventWhen&&T.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){E(e);return}(null==(n=e.target)||!n.isContentEditable||null!=T&&T.enableOnContentEditable)&&l(k,null==T?void 0:T.splitKey).forEach(function(n){var o,r,a,i,c,l,u,d=s(n,null==T?void 0:T.combinationKey);if(v(e,d,null==T?void 0:T.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(t&&C.current)return;if(o=e,r=d,("function"==typeof(a=null==T?void 0:T.preventDefault)&&a(o,r)||!0===a)&&o.preventDefault(),i=e,c=d,"function"==typeof(l=null==T?void 0:T.enabled)?!l(i,c):!0!==l&&void 0!==l){E(e);return}S.current(e,d),t||(C.current=!0)}})}},o=function(e){void 0!==e.key&&(f(c(e.code)),((null==T?void 0:T.keydown)===void 0&&(null==T?void 0:T.keyup)!==!0||null!=T&&T.keydown)&&n(e))},r=function(e){void 0!==e.key&&(p(c(e.code)),C.current=!1,null!=T&&T.keyup&&n(e,!0))},a=u.current||(null==w?void 0:w.document)||document;return a.addEventListener("keyup",r),a.addEventListener("keydown",o),A&&l(k,null==T?void 0:T.splitKey).forEach(function(e){return A.addHotkey(s(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))}),function(){a.removeEventListener("keyup",r),a.removeEventListener("keydown",o),A&&l(k,null==T?void 0:T.splitKey).forEach(function(e){return A.removeHotkey(s(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))})}}},[k,T,L]),u}}}]);
|
|
5
|
+
*/ !function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=r.apply(null,n);a&&e.push(a)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var c in n)o.call(n,c)&&n[c]&&e.push(c)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0!==(n=(function(){return r}).apply(t,[]))&&(e.exports=n)}()},79797:function(e,t,n){"use strict";n.d(t,{Z:function(){return eo}});var o,r=n(7896),i=n(59740),a=n(9249),c=n(87371),l=n(45754),s=n(4309),u=n(80753),d=n(56666),f=n(86522),p=n(2784),m=function(e){return+setTimeout(e,16)},v=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(m=function(e){return window.requestAnimationFrame(e)},v=function(e){return window.cancelAnimationFrame(e)});var h=0,y=new Map;function g(e){y.delete(e)}var E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return h+=1,!function t(n){if(0===n)g(h),e();else{var o=m(function(){t(n-1)});y.set(h,o)}}(t),h};E.cancel=function(e){var t=y.get(e);return g(t),v(t)};var C=n(28316);function w(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}var b=(0,p.forwardRef)(function(e,t){var n=e.didUpdate,o=e.getContainer,r=e.children,i=(0,p.useRef)(),a=(0,p.useRef)();(0,p.useImperativeHandle)(t,function(){return{}});var c=(0,p.useRef)(!1);return!c.current&&w()&&(a.current=o(),i.current=a.current.parentNode,c.current=!0),(0,p.useEffect)(function(){null==n||n(e)}),(0,p.useEffect)(function(){return null===a.current.parentNode&&null!==i.current&&i.current.appendChild(a.current),function(){var e,t;null===(e=a.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(a.current)}},[]),a.current?C.createPortal(r,a.current):null});function k(e){if("undefined"==typeof document)return 0;if(e||void 0===o){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var i=t.offsetWidth;n.style.overflow="scroll";var a=t.offsetWidth;i===a&&(a=n.clientWidth),document.body.removeChild(n),o=i-a}return o}var N=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{};var n=t.element,o=void 0===n?document.body:n,r={},i=Object.keys(e);return i.forEach(function(e){r[e]=o.style[e]}),i.forEach(function(t){o.style[t]=e[t]}),r},S={},T=function(e){if(document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth||e){var t="ant-scrolling-effect",n=RegExp("".concat(t),"g"),o=document.body.className;if(e){if(!n.test(o))return;N(S),S={},document.body.className=o.replace(n,"").trim();return}var r=k();if(r&&(S=N({position:"relative",width:"calc(100% - ".concat(r,"px)")}),!n.test(o))){var i="".concat(o," ").concat(t);document.body.className=i.trim()}}},A=n(51171),L=0,O=[],Z="ant-scrolling-effect",M=RegExp("".concat(Z),"g"),R=new Map,D=(0,c.Z)(function e(t){var n=this;(0,a.Z)(this,e),(0,d.Z)(this,"lockTarget",void 0),(0,d.Z)(this,"options",void 0),(0,d.Z)(this,"getContainer",function(){var e;return null===(e=n.options)||void 0===e?void 0:e.container}),(0,d.Z)(this,"reLock",function(e){var t=O.find(function(e){return e.target===n.lockTarget});t&&n.unLock(),n.options=e,t&&(t.options=e,n.lock())}),(0,d.Z)(this,"lock",function(){if(!O.some(function(e){return e.target===n.lockTarget})){if(O.some(function(e){var t,o=e.options;return(null==o?void 0:o.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})){O=[].concat((0,A.Z)(O),[{target:n.lockTarget,options:n.options}]);return}var e,t=0,o=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body;(o===document.body&&window.innerWidth-document.documentElement.clientWidth>0||o.scrollHeight>o.clientHeight)&&"hidden"!==getComputedStyle(o).overflow&&(t=k());var r=o.className;if(0===O.filter(function(e){var t,o=e.options;return(null==o?void 0:o.container)===(null===(t=n.options)||void 0===t?void 0:t.container)}).length&&R.set(o,N({width:0!==t?"calc(100% - ".concat(t,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:o})),!M.test(r)){var i="".concat(r," ").concat(Z);o.className=i.trim()}O=[].concat((0,A.Z)(O),[{target:n.lockTarget,options:n.options}])}}),(0,d.Z)(this,"unLock",function(){var e,t=O.find(function(e){return e.target===n.lockTarget});if(O=O.filter(function(e){return e.target!==n.lockTarget}),!(!t||O.some(function(e){var n,o=e.options;return(null==o?void 0:o.container)===(null===(n=t.options)||void 0===n?void 0:n.container)}))){var o=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body,r=o.className;M.test(r)&&(N(R.get(o),{element:o}),R.delete(o),o.className=o.className.replace(M,"").trim())}}),this.lockTarget=L++,this.options=t}),P=0,_=w(),I={},U=function(e){if(!_)return null;if(e){if("string"==typeof e)return document.querySelectorAll(e)[0];if("function"==typeof e)return e();if("object"===(0,f.Z)(e)&&e instanceof window.HTMLElement)return e}return document.body},H=function(e){(0,l.Z)(n,e);var t=(0,s.Z)(n);function n(e){var o;return(0,a.Z)(this,n),o=t.call(this,e),(0,d.Z)((0,u.Z)(o),"container",void 0),(0,d.Z)((0,u.Z)(o),"componentRef",p.createRef()),(0,d.Z)((0,u.Z)(o),"rafId",void 0),(0,d.Z)((0,u.Z)(o),"scrollLocker",void 0),(0,d.Z)((0,u.Z)(o),"renderComponent",void 0),(0,d.Z)((0,u.Z)(o),"updateScrollLocker",function(e){var t=(e||{}).visible,n=o.props,r=n.getContainer,i=n.visible;i&&i!==t&&_&&U(r)!==o.scrollLocker.getContainer()&&o.scrollLocker.reLock({container:U(r)})}),(0,d.Z)((0,u.Z)(o),"updateOpenCount",function(e){var t=e||{},n=t.visible,r=t.getContainer,i=o.props,a=i.visible,c=i.getContainer;a!==n&&_&&U(c)===document.body&&(a&&!n?P+=1:e&&(P-=1)),("function"==typeof c&&"function"==typeof r?c.toString()!==r.toString():c!==r)&&o.removeCurrentContainer()}),(0,d.Z)((0,u.Z)(o),"attachToParent",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.container&&!o.container.parentNode){var t=U(o.props.getContainer);return!!t&&(t.appendChild(o.container),!0)}return!0}),(0,d.Z)((0,u.Z)(o),"getContainer",function(){return _?(o.container||(o.container=document.createElement("div"),o.attachToParent(!0)),o.setWrapperClassName(),o.container):null}),(0,d.Z)((0,u.Z)(o),"setWrapperClassName",function(){var e=o.props.wrapperClassName;o.container&&e&&e!==o.container.className&&(o.container.className=e)}),(0,d.Z)((0,u.Z)(o),"removeCurrentContainer",function(){var e,t;null===(e=o.container)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(o.container)}),(0,d.Z)((0,u.Z)(o),"switchScrollingEffect",function(){1!==P||Object.keys(I).length?P||(N(I),I={},T(!0)):(T(),I=N({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}))}),o.scrollLocker=new D({container:U(e.getContainer)}),o}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e=this;this.updateOpenCount(),this.attachToParent()||(this.rafId=E(function(){e.forceUpdate()}))}},{key:"componentDidUpdate",value:function(e){this.updateOpenCount(e),this.updateScrollLocker(e),this.setWrapperClassName(),this.attachToParent()}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visible,n=e.getContainer;_&&U(n)===document.body&&(P=t&&P?P-1:P),this.removeCurrentContainer(),E.cancel(this.rafId)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.forceRender,o=e.visible,r=null,i={getOpenCount:function(){return P},getContainer:this.getContainer,switchScrollingEffect:this.switchScrollingEffect,scrollLocker:this.scrollLocker};return(n||o||this.componentRef.current)&&(r=p.createElement(b,{getContainer:this.getContainer,ref:this.componentRef},t(i))),r}}]),n}(p.Component),F=n(33028),K=n(72779),W=n.n(K),x={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=x.F1&&t<=x.F12)return!1;switch(t){case x.ALT:case x.CAPS_LOCK:case x.CONTEXT_MENU:case x.CTRL:case x.DOWN:case x.END:case x.ESC:case x.HOME:case x.INSERT:case x.LEFT:case x.MAC_FF_META:case x.META:case x.NUMLOCK:case x.NUM_CENTER:case x.PAGE_DOWN:case x.PAGE_UP:case x.PAUSE:case x.PRINT_SCREEN:case x.RIGHT:case x.SHIFT:case x.UP:case x.WIN_KEY:case x.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=x.ZERO&&e<=x.NINE||e>=x.NUM_ZERO&&e<=x.NUM_MULTIPLY||e>=x.A&&e<=x.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case x.SPACE:case x.QUESTION_MARK:case x.NUM_PLUS:case x.NUM_MINUS:case x.NUM_PERIOD:case x.NUM_DIVISION:case x.SEMICOLON:case x.DASH:case x.EQUALS:case x.COMMA:case x.PERIOD:case x.SLASH:case x.APOSTROPHE:case x.SINGLE_QUOTE:case x.OPEN_SQUARE_BRACKET:case x.BACKSLASH:case x.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},j={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},B=Object.keys(j).filter(function(e){if("undefined"==typeof document)return!1;var t=document.getElementsByTagName("html")[0];return e in(t?t.style:{})})[0],X=j[B];function Y(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function V(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.attachEvent&&e.detachEvent("on".concat(t),n)}var G=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Q=!("undefined"!=typeof window&&window.document&&window.document.createElement),z=function e(t,n,o,r){if(!n||n===document||n instanceof Document)return!1;if(n===t.parentNode)return!0;var i=n.scrollHeight-n.clientHeight,a=n.scrollWidth-n.clientWidth,c=document.defaultView.getComputedStyle(n),l="auto"===c.overflowY||"scroll"===c.overflowY,s="auto"===c.overflowX||"scroll"===c.overflowX,u=i&&l,d=a&&s;return(Math.max(Math.abs(o),Math.abs(r))===Math.abs(r)&&(!u||!!u&&(n.scrollTop>=i&&r<0||n.scrollTop<=0&&r>0))||Math.max(Math.abs(o),Math.abs(r))===Math.abs(o)&&(!d||!!d&&(n.scrollLeft>=a&&o<0||n.scrollLeft<=0&&o>0)))&&e(t,n.parentNode,o,r)},q=["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","scrollLocker","contentWrapperStyle"],$={},J=function(e){(0,l.Z)(n,e);var t=(0,s.Z)(n);function n(e){var o;return(0,a.Z)(this,n),(o=t.call(this,e)).levelDom=void 0,o.dom=void 0,o.contentWrapper=void 0,o.contentDom=void 0,o.maskDom=void 0,o.handlerDom=void 0,o.drawerId=void 0,o.timeout=void 0,o.passive=void 0,o.startPos=void 0,o.domFocus=function(){o.dom&&o.dom.focus()},o.removeStartHandler=function(e){if(e.touches.length>1){o.startPos=null;return}o.startPos={x:e.touches[0].clientX,y:e.touches[0].clientY}},o.removeMoveHandler=function(e){if(!(e.changedTouches.length>1)&&o.startPos){var t=e.currentTarget,n=e.changedTouches[0].clientX-o.startPos.x,r=e.changedTouches[0].clientY-o.startPos.y;(t===o.maskDom||t===o.handlerDom||t===o.contentDom&&z(t,e.target,n,r))&&e.cancelable&&e.preventDefault()}},o.transitionEnd=function(e){var t=e.target;V(t,X,o.transitionEnd),t.style.transition=""},o.onKeyDown=function(e){if(e.keyCode===x.ESC){var t=o.props.onClose;e.stopPropagation(),t&&t(e)}},o.onWrapperTransitionEnd=function(e){var t=o.props,n=t.open,r=t.afterVisibleChange;e.target===o.contentWrapper&&e.propertyName.match(/transform$/)&&(o.dom.style.transition="",!n&&o.getCurrentDrawerSome()&&(document.body.style.overflowX="",o.maskDom&&(o.maskDom.style.left="",o.maskDom.style.width="")),r&&r(!!n))},o.openLevelTransition=function(){var e=o.props,t=e.open,n=e.width,r=e.height,i=o.getHorizontalBoolAndPlacementName(),a=i.isHorizontal,c=i.placementName,l=o.contentDom?o.contentDom.getBoundingClientRect()[a?"width":"height"]:0;o.setLevelAndScrolling(t,c,(a?n:r)||l)},o.setLevelTransform=function(e,t,n,r){var i=o.props,a=i.placement,c=i.levelMove,l=i.duration,s=i.ease,u=i.showMask;o.levelDom.forEach(function(i){i.style.transition="transform ".concat(l," ").concat(s),Y(i,X,o.transitionEnd);var d=e?n:0;if(c){var f,p,m,v=(f=c,p={target:i,open:e},m="function"==typeof f?f(p):f,Array.isArray(m)?2===m.length?m:[m[0],m[1]]:[m]);d=e?v[0]:v[1]||0}var h="number"==typeof d?"".concat(d,"px"):d,y="left"===a||"top"===a?h:"-".concat(h);y=u&&"right"===a&&r?"calc(".concat(y," + ").concat(r,"px)"):y,i.style.transform=d?"".concat(t,"(").concat(y,")"):""})},o.setLevelAndScrolling=function(e,t,n){var r=o.props.onChange;if(!Q){var i=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?k(!0):0;o.setLevelTransform(e,t,n,i),o.toggleScrollingToDrawerAndBody(i)}r&&r(e)},o.toggleScrollingToDrawerAndBody=function(e){var t=o.props,n=t.getContainer,r=t.showMask,i=t.open,a=n&&n();if(a&&a.parentNode===document.body&&r){var c=["touchstart"],l=[document.body,o.maskDom,o.handlerDom,o.contentDom];i&&"hidden"!==document.body.style.overflow?(e&&o.addScrollingEffect(e),document.body.style.touchAction="none",l.forEach(function(e,t){e&&Y(e,c[t]||"touchmove",t?o.removeMoveHandler:o.removeStartHandler,o.passive)})):o.getCurrentDrawerSome()&&(document.body.style.touchAction="",e&&o.remScrollingEffect(e),l.forEach(function(e,t){e&&V(e,c[t]||"touchmove",t?o.removeMoveHandler:o.removeStartHandler,o.passive)}))}},o.addScrollingEffect=function(e){var t=o.props,n=t.placement,r=t.duration,i=t.ease,a="width ".concat(r," ").concat(i),c="transform ".concat(r," ").concat(i);switch(o.dom.style.transition="none",n){case"right":o.dom.style.transform="translateX(-".concat(e,"px)");break;case"top":case"bottom":o.dom.style.width="calc(100% - ".concat(e,"px)"),o.dom.style.transform="translateZ(0)"}clearTimeout(o.timeout),o.timeout=setTimeout(function(){o.dom&&(o.dom.style.transition="".concat(c,",").concat(a),o.dom.style.width="",o.dom.style.transform="")})},o.remScrollingEffect=function(e){var t,n=o.props,r=n.placement,i=n.duration,a=n.ease;B&&(document.body.style.overflowX="hidden"),o.dom.style.transition="none";var c="width ".concat(i," ").concat(a),l="transform ".concat(i," ").concat(a);switch(r){case"left":o.dom.style.width="100%",c="width 0s ".concat(a," ").concat(i);break;case"right":o.dom.style.transform="translateX(".concat(e,"px)"),o.dom.style.width="100%",c="width 0s ".concat(a," ").concat(i),o.maskDom&&(o.maskDom.style.left="-".concat(e,"px"),o.maskDom.style.width="calc(100% + ".concat(e,"px)"));break;case"top":case"bottom":o.dom.style.width="calc(100% + ".concat(e,"px)"),o.dom.style.height="100%",o.dom.style.transform="translateZ(0)",t="height 0s ".concat(a," ").concat(i)}clearTimeout(o.timeout),o.timeout=setTimeout(function(){o.dom&&(o.dom.style.transition="".concat(l,",").concat(t?"".concat(t,","):"").concat(c),o.dom.style.transform="",o.dom.style.width="",o.dom.style.height="")})},o.getCurrentDrawerSome=function(){return!Object.keys($).some(function(e){return $[e]})},o.getLevelDom=function(e){var t,n=e.level,r=e.getContainer;if(!Q){var i=r&&r(),a=i?i.parentNode:null;(o.levelDom=[],"all"===n)?(a?Array.prototype.slice.call(a.children):[]).forEach(function(e){"SCRIPT"!==e.nodeName&&"STYLE"!==e.nodeName&&"LINK"!==e.nodeName&&e!==i&&o.levelDom.push(e)}):n&&(Array.isArray(t=n)?t:[t]).forEach(function(e){document.querySelectorAll(e).forEach(function(e){o.levelDom.push(e)})})}},o.getHorizontalBoolAndPlacementName=function(){var e=o.props.placement,t="left"===e||"right"===e,n="translate".concat(t?"X":"Y");return{isHorizontal:t,placementName:n}},o.state={_self:(0,u.Z)(o)},o}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e,t=this;if(!Q){var n=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return n=!0,null}}))}catch(o){}this.passive=!!n&&{passive:!1}}var r=this.props,i=r.open,a=r.getContainer,c=r.showMask,l=r.autoFocus,s=a&&a();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(9*Math.random()).toString())).toString(16)),this.getLevelDom(this.props),i&&(s&&s.parentNode===document.body&&($[this.drawerId]=i),this.openLevelTransition(),this.forceUpdate(function(){l&&t.domFocus()}),c&&(null===(e=this.props.scrollLocker)||void 0===e||e.lock()))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.open,o=t.getContainer,r=t.scrollLocker,i=t.showMask,a=t.autoFocus,c=o&&o();n!==e.open&&(c&&c.parentNode===document.body&&($[this.drawerId]=!!n),this.openLevelTransition(),n?(a&&this.domFocus(),i&&(null==r||r.lock())):null==r||r.unLock())}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.open,n=e.scrollLocker;delete $[this.drawerId],t&&(this.setLevelTransform(!1),document.body.style.touchAction=""),null==n||n.unLock()}},{key:"render",value:function(){var e,t,n,o,a=this,c=this.props,l=c.className,s=c.children,u=c.style,f=c.width,m=c.height,v=(c.defaultOpen,c.open),h=c.prefixCls,y=c.placement,g=(c.level,c.levelMove,c.ease,c.duration,c.getContainer,c.handler),E=(c.onChange,c.afterVisibleChange,c.showMask),C=c.maskClosable,w=c.maskStyle,b=c.onClose,k=c.onHandleClick,N=c.keyboard,S=(c.getOpenCount,c.scrollLocker,c.contentWrapperStyle),T=(0,i.Z)(c,q),A=!!this.dom&&v,L=W()(h,(e={},(0,d.Z)(e,"".concat(h,"-").concat(y),!0),(0,d.Z)(e,"".concat(h,"-open"),A),(0,d.Z)(e,l||"",!!l),(0,d.Z)(e,"no-mask",!E),e)),O=this.getHorizontalBoolAndPlacementName().placementName,Z=A?"":"".concat(O,"(").concat("left"===y||"top"===y?"-100%":"100%",")"),M=g&&p.cloneElement(g,{onClick:function(e){g.props.onClick&&g.props.onClick(),k&&k(e)},ref:function(e){a.handlerDom=e}});return p.createElement("div",(0,r.Z)({},(n=["switchScrollingEffect","autoFocus"],o=(0,F.Z)({},T),Array.isArray(n)&&n.forEach(function(e){delete o[e]}),o),{tabIndex:-1,className:L,style:u,ref:function(e){a.dom=e},onKeyDown:A&&N?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),E&&p.createElement("div",{className:"".concat(h,"-mask"),onClick:C?b:void 0,style:w,ref:function(e){a.maskDom=e}}),p.createElement("div",{className:"".concat(h,"-content-wrapper"),style:(0,F.Z)({transform:Z,msTransform:Z,width:G(f)?"".concat(f,"px"):f,height:G(m)?"".concat(m,"px"):m},S),ref:function(e){a.contentWrapper=e}},p.createElement("div",{className:"".concat(h,"-content"),ref:function(e){a.contentDom=e}},s),M))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,o=t._self;if(void 0!==n){var r=e.placement,i=e.level;r!==n.placement&&(o.contentDom=null),i!==n.level&&o.getLevelDom(e)}return{prevProps:e}}}]),n}(p.Component),ee=["defaultOpen","getContainer","wrapperClassName","forceRender","handler"],et=["visible","afterClose"],en=function(e){(0,l.Z)(n,e);var t=(0,s.Z)(n);function n(e){(0,a.Z)(this,n),(o=t.call(this,e)).dom=void 0,o.onHandleClick=function(e){var t=o.props,n=t.onHandleClick,r=t.open;if(n&&n(e),void 0===r){var i=o.state.open;o.setState({open:!i})}},o.onClose=function(e){var t=o.props,n=t.onClose,r=t.open;n&&n(e),void 0===r&&o.setState({open:!1})};var o,r=void 0!==e.open?e.open:!!e.defaultOpen;return o.state={open:r},"onMaskClick"in e&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),o}return(0,c.Z)(n,[{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultOpen,t.getContainer),o=t.wrapperClassName,a=t.forceRender,c=t.handler,l=(0,i.Z)(t,ee),s=this.state.open;return n?p.createElement(H,{visible:s,forceRender:!!c||a,getContainer:n,wrapperClassName:o},function(t){var n=t.visible,o=t.afterClose,a=(0,i.Z)(t,et);return p.createElement(J,(0,r.Z)({},l,a,{open:void 0!==n?n:s,afterVisibleChange:void 0!==o?o:l.afterVisibleChange,handler:c,onClose:e.onClose,onHandleClick:e.onHandleClick}))}):p.createElement("div",{className:o,ref:function(t){e.dom=t}},p.createElement(J,(0,r.Z)({},l,{open:s,handler:c,getContainer:function(){return e.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,o={prevProps:e};return void 0!==n&&e.open!==n.open&&(o.open=e.open),o}}]),n}(p.Component);en.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:p.createElement("div",{className:"drawer-handle"},p.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1,autoFocus:!0};var eo=en},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return C}});var o=n(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}n(52322);var i=["shift","alt","meta","mod","ctrl"],a={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function c(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function l(e,t){return void 0===t&&(t=","),e.split(t)}function s(e,t,n){void 0===t&&(t="+");var o,a=e.toLocaleLowerCase().split(t).map(function(e){return c(e)});return r({},{alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod")},{keys:a.filter(function(e){return!i.includes(e)}),description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([c(e.key),c(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&p([c(e.key),c(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var t=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var t;return!i.includes(e)&&u.delete(e.toLowerCase())}),t.forEach(function(e){return u.add(e.toLowerCase())})}function p(e){var t=Array.isArray(e)?e:[e];"meta"===e?u.clear():t.forEach(function(e){return u.delete(e.toLowerCase())})}function m(e,t){var n=e.target;void 0===t&&(t=!1);var o=n&&n.tagName;return d(t)?Boolean(o&&t&&t.some(function(e){return e.toLowerCase()===o.toLowerCase()})):Boolean(o&&t&&!0===t)}var v=function(e,t,n){void 0===n&&(n=!1);var o,r,i=t.alt,a=t.meta,l=t.mod,s=t.shift,f=t.ctrl,p=t.keys,m=e.key,v=e.code,h=e.ctrlKey,y=e.metaKey,g=e.shiftKey,E=e.altKey,C=c(v),w=m.toLowerCase();if(!n){if(!E===i&&"alt"!==w||!g===s&&"shift"!==w)return!1;if(l){if(!y&&!h)return!1}else if(!y===a&&"meta"!==w&&"os"!==w||!h===f&&"ctrl"!==w&&"control"!==w)return!1}return!!(p&&1===p.length&&(p.includes(w)||p.includes(C)))||(p?(void 0===r&&(r=","),(d(o=p)?o:o.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!p)},h=(0,o.createContext)(void 0),y=(0,o.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),g=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},E="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;function C(e,t,n,r){var i,a,u=(0,o.useRef)(null),C=(0,o.useRef)(!1),w=n instanceof Array?r instanceof Array?void 0:r:n,b=d(e)?e.join(null==w?void 0:w.splitKey):e,k=n instanceof Array?n:r instanceof Array?r:void 0,N=(0,o.useCallback)(t,null!=k?k:[]),S=(0,o.useRef)(N);k?S.current=N:S.current=t;var T=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(o,r){return o&&e(t[r],n[r])},!0):t===n}((a=(0,o.useRef)(void 0)).current,w)&&(a.current=w),a.current),A=(0,o.useContext)(y).enabledScopes,L=(0,o.useContext)(h);return E(function(){if((null==T?void 0:T.enabled)!==!1&&(e=A,t=null==T?void 0:T.scopes,0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!t||e.some(function(e){return t.includes(e)})||e.includes("*")))){var e,t,n=function(e,t){var n,o;if(void 0===t&&(t=!1),!(m(e,["input","textarea","select"])&&!m(e,null==T?void 0:T.enableOnFormTags)||null!=T&&null!=T.ignoreEventWhen&&T.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){g(e);return}(null==(n=e.target)||!n.isContentEditable||null!=T&&T.enableOnContentEditable)&&l(b,null==T?void 0:T.splitKey).forEach(function(n){var o,r,i,a,c,l,u,d=s(n,null==T?void 0:T.combinationKey);if(v(e,d,null==T?void 0:T.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(t&&C.current)return;if(o=e,r=d,("function"==typeof(i=null==T?void 0:T.preventDefault)&&i(o,r)||!0===i)&&o.preventDefault(),a=e,c=d,"function"==typeof(l=null==T?void 0:T.enabled)?!l(a,c):!0!==l&&void 0!==l){g(e);return}S.current(e,d),t||(C.current=!0)}})}},o=function(e){void 0!==e.key&&(f(c(e.code)),((null==T?void 0:T.keydown)===void 0&&(null==T?void 0:T.keyup)!==!0||null!=T&&T.keydown)&&n(e))},r=function(e){void 0!==e.key&&(p(c(e.code)),C.current=!1,null!=T&&T.keyup&&n(e,!0))},i=u.current||(null==w?void 0:w.document)||document;return i.addEventListener("keyup",r),i.addEventListener("keydown",o),L&&l(b,null==T?void 0:T.splitKey).forEach(function(e){return L.addHotkey(s(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))}),function(){i.removeEventListener("keyup",r),i.removeEventListener("keydown",o),L&&l(b,null==T?void 0:T.splitKey).forEach(function(e){return L.removeHotkey(s(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))})}}},[b,T,A]),u}},926:function(e,t,n){"use strict";function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}n.d(t,{Z:function(){return o}})},9249:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}n.d(t,{Z:function(){return o}})},87371:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var o=n(32802);function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,o.Z)(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var o=n(95058),r=n(98621),i=n(86522),a=n(80753);function c(e){var t=(0,r.Z)();return function(){var n,r=(0,o.Z)(e);if(t){var c=(0,o.Z)(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===(0,i.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return(0,a.Z)(e)}(this,n)}}},45754:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var o=n(88960);function r(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,o.Z)(e,t)}},59740:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var o=n(31461);function r(e,t){if(null==e)return{};var n,r,i=(0,o.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},51171:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var o=n(926),r=n(59147);function i(e){return function(e){if(Array.isArray(e))return(0,o.Z)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,r.Z)(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},59147:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var o=n(926);function r(e,t){if(e){if("string"==typeof e)return(0,o.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,o.Z)(e,t)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[917],{8799:function(t,a,r){r.d(a,{FQA:function(){return i},KyO:function(){return c},XGl:function(){return e},iTs:function(){return l},jnY:function(){return u},vcz:function(){return h}});var n=r(68281);function l(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z"}}]})(t)}function h(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8l3.147-3.146zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8l-3.147-3.146z"}}]})(t)}function u(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"}},{tag:"path",attr:{d:"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"}}]})(t)}function c(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"}},{tag:"path",attr:{d:"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"}}]})(t)}function i(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"}}]})(t)}function e(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5 3a5 5 0 0 0 0 10h6a5 5 0 0 0 0-10H5zm6 9a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"}}]})(t)}}}]);
|