summaryrefslogtreecommitdiffhomepage
path: root/ComboEditorTab.fb7b39eae888f425ecc2.js
blob: 9a4d75a021f4e33695073f8cd38f2975952f8479 (plain)
1
2
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8315],{94062:function(n,e,r){r.d(e,{Z:function(){return a}});var t=r(41051),o=r(2968),i=r(85893);function a(n){var e=n.url,r=n.text;return(0,i.jsxs)(o.Z,{external:!0,href:e,children:[(0,i.jsx)(t.Z,{name:"book"})," ",(0,i.jsx)("span",{children:r})]})}},60439:function(n,e,r){r.d(e,{Z:function(){return N}});var t=r(94184),o=r.n(t),i=r(6557),a=r.n(i),l=r(67294),c=r(45697),s=r.n(c),u=r(93379),A=r.n(u),p=r(7795),d=r.n(p),b=r(90569),f=r.n(b),m=r(3565),y=r.n(m),C=r(19216),h=r.n(C),v=r(44589),g=r.n(v),x=r(86015),E={};E.styleTagTransform=g(),E.setAttributes=y(),E.insert=f().bind(null,"head"),E.domAPI=d(),E.insertStyleElement=h(),A()(x.Z,E);var j=x.Z&&x.Z.locals?x.Z.locals:void 0,B=r(41051),w=r(56803),k=r(21517),O=r(85893);function S(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(n,e)||function(n,e){if(n){if("string"==typeof n)return Z(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(n,e):void 0}}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function N(n){var e=n.value,r=n.validate,t=n.required,i=n.render,a=n.onUpdate,c=n.showEditOnHover,s=S((0,l.useState)(!1),2),u=s[0],A=s[1],p=(0,l.useCallback)((function(n){A(!1),a(n)}),[A,a]),d=(0,l.useCallback)((function(){A(!1)}),[A]);return u?(0,O.jsx)(P,{value:e,validate:r,required:t,onConfirm:p,onCancel:d}):i((0,O.jsxs)("span",{className:j.container,"data-show-edit-on-hover":c,children:[(0,O.jsx)("span",{children:e}),(0,O.jsx)(B.Z,{name:"pencil",title:"Edit",className:o()(j.edit,j.buttonIcon),onClick:(0,w.s)((function(){return A(!0)}))})]}))}function P(n){var e=n.value,r=n.validate,t=n.required,o=n.onConfirm,i=n.onCancel,a=(0,l.useRef)(),c=S((0,l.useState)({value:e,attemptedEmpty:!1}),2),s=c[0],u=s.value,A=s.attemptedEmpty,p=c[1],d=t&&A?"cannot be empty":r&&r(u),b=(0,l.useCallback)((function(n){n&&(n.focus(),n.select())}),[]),f=(0,l.useCallback)((function(n){p({attemptedEmpty:!1,value:n.target.value})}),[p]),m=(0,l.useCallback)((function(){""===u&&t?p({value:"",attemptedEmpty:!0}):d||o(u)}),[u,t,d,o,p]);return(0,k.Z)(a,i,!d),(0,O.jsxs)("span",{className:j.container,ref:a,children:[(0,O.jsx)("input",{ref:b,value:u,onChange:f,onKeyDown:(0,w.w)({Enter:m,Escape:i})}),d&&(0,O.jsx)("span",{className:j.error,children:d}),(0,O.jsxs)("span",{style:{display:"inline flex",flexDirection:"row",gap:"5px",marginLeft:"5px"},children:[(0,O.jsx)(B.Z,{name:"check",title:"Accept",className:j.buttonIcon,onClick:m,disabled:d}),(0,O.jsx)(B.Z,{name:"rotate-left",title:"Reset",className:j.buttonIcon,onClick:i})]})]})}N.propTypes={value:s().string.isRequired,validate:s().func,required:s().bool.isRequired,render:s().func.isRequired,onUpdate:s().func.isRequired,showEditOnHover:s().bool.isRequired},N.defaultProps={render:a(),required:!0,showEditOnHover:!1}},56628:function(n,e,r){r.r(e),r.d(e,{default:function(){return wn}});var t=r(50361),o=r.n(t),i=r(67294),a=r(95998),l=r(45697),c=r.n(l),s=r(93379),u=r.n(s),A=r(7795),p=r.n(A),d=r(90569),b=r.n(d),f=r(3565),m=r.n(f),y=r(19216),C=r.n(y),h=r(44589),v=r.n(h),g=r(78207),x={};x.styleTagTransform=v(),x.setAttributes=m(),x.insert=b().bind(null,"head"),x.domAPI=p(),x.insertStyleElement=C(),u()(g.Z,x);var E=g.Z&&g.Z.locals?g.Z.locals:void 0,j=r(15023),B=r(85893);function w(){return(0,B.jsx)("p",{className:E.floatingMessage,children:"Click on a key to add it to the combo"})}function k(n){var e=n.keyPositions,r=n.onUpdate;return(0,B.jsxs)("div",{className:E.comboInputMap,children:[(0,B.jsx)(j.Z,{value:e,onUpdate:r}),e.length<2&&(0,B.jsx)(w,{})]})}k.propTypes={onUpdate:c().func.isRequired,keyPositions:c().arrayOf(c().number).isRequired};var O=k,S=r(82607),Z=r(61953),N=r(27926),P=r(41051),I=r(94062),Y=r(60439),R=r(81485),D=r(57557),X=r.n(D),q=r(64261),U=r(96186),F=r(91892),z=r(80736);function J(n){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},J(n)}function W(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function K(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){M(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function M(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==J(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==J(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===J(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function T(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}var V=function(n){var e,r,t,o,l,c=n.combo,s=n.onUpdate,u=n.onCancel,A=(0,a.v9)(z.vl),p=(o=(0,i.useState)(c),l=2,function(n){if(Array.isArray(n))return n}(o)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(o,l)||function(n,e){if(n){if("string"==typeof n)return T(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(n,e):void 0}}(o,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=p[0],b=p[1],f=(0,i.useMemo)((function(){return A.map((function(n,e){return{id:e,label:(0,z.EI)(n)}}))}),[A]),m=(0,i.useMemo)((function(){var n;return((null===(n=d.properties.layers)||void 0===n?void 0:n.parsed)||[]).map((function(n){return f.find((function(e){return e.id===n}))}))}),[d,f]),y=(0,i.useCallback)((function(n){return b((function(e){return K(K({},e),{},{properties:K(K({},e.properties),{},{layers:{parsed:n.map((function(n){return n.id}))}})})}))}),[b]);return(0,B.jsx)(q.Z,{onDismiss:u,children:(0,B.jsxs)(U.Z,{dismissText:null,children:[(0,B.jsxs)("h2",{children:["Customize ",(0,B.jsx)("code",{children:c.name})]}),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"customize-combo-timeout",children:"Timeout (ms)"}),(0,B.jsx)("input",{id:"customize-combo-timeout",type:"number",placeholder:"Default",value:(null===(e=d.properties["timeout-ms"])||void 0===e?void 0:e.parsed)||"",onChange:function(n){var e=Number(n.target.value);b((function(r){return K(K({},r),{},{properties:""!==n.target.value?K(K({},r.properties),{},{"timeout-ms":{parsed:e}}):K({},X()(r.properties,"timeout-ms"))})}))}})]}),(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"customize-combo-idle",children:"Require Prior Idle (ms)"}),(0,B.jsx)("input",{id:"customize-combo-idle",type:"number",placeholder:"Default",value:(null===(r=d.properties["require-prior-idle-ms"])||void 0===r?void 0:r.parsed)||"",onChange:function(n){var e=Number(n.target.value);b((function(r){return K(K({},r),{},{properties:""!==n.target.value?K(K({},r.properties),{},{"require-prior-idle-ms":{parsed:e}}):K({},X()(r.properties,"require-prior-idle-ms"))})}))}})]}),(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"customize-combo-slow-release",children:"Slow Release"}),(0,B.jsx)("input",{id:"customize-combo-slow-release",type:"checkbox",checked:(null===(t=d.properties["slow-release"])||void 0===t?void 0:t.parsed)||!1,onChange:function(n){return b((function(e){return K(K({},e),{},{properties:K(K({},e.properties),{},{"slow-release":{parsed:n.target.checked}})})}))}})]}),(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"pending_layers",children:"Layers"}),(0,B.jsx)(F.Z,{isMulti:!0,isSearchable:!0,id:"pending_layers",value:m,options:f,onChange:y,getOptionValue:function(n){return n.id}})]}),(0,B.jsxs)("div",{style:{textAlign:"center",marginTop:"10px"},children:[(0,B.jsx)(N.Z,{onClick:function(){s(d)},children:"Okay"}),(0,B.jsx)(N.Z,{onClick:u,secondary:!0,children:"Cancel"})]})]})]})})},Q=r(62417),G=r(76106),L=r(94596),_=r(80671),H=r(58887),$=r(91118),nn=r(2732);function en(n){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},en(n)}function rn(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function tn(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rn(Object(r),!0).forEach((function(e){on(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):rn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function on(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==en(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==en(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===en(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function an(n){return(0,B.jsx)(_.Z,tn(tn({},n),{},{Heading:ln}))}function ln(n){var e=n.bindingIndex,r=n.bindTree,t=(0,a.v9)(nn.DP)[e];return t?(0,B.jsxs)("div",{className:L.Z.keyBindingHeader,children:[(0,B.jsx)(H.Z,{keyPositions:t.properties["key-positions"].parsed,styleOverrides:{display:"inline-block",padding:"3px",borderRadius:"3px"},scale:.15}),(0,B.jsx)(P.Z,{name:"arrow-right"}),(0,B.jsx)($.Z,{selectable:!1,children:(0,B.jsx)(G.Z,{value:r})})]}):null}function cn(n){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},cn(n)}function sn(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function un(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?sn(Object(r),!0).forEach((function(e){An(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):sn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function An(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==cn(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==cn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===cn(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function pn(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(n,e)||function(n,e){if(n){if("string"==typeof n)return dn(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dn(n,e):void 0}}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dn(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function bn(n){var e,r=n.onSubmit,t=n.onCancel,o=n.initial,a=void 0===o?fn:o,l=(e=(0,i.useContext)(R.c).identifiers,(0,i.useCallback)((function(n){return(0,Q.G3)(n)||(e.includes(n)?'Cannot use existing identifier "'.concat(n,'"'):null)}),[e])),c=pn((0,i.useState)(a),2),s=c[0],u=c[1],A=pn((0,q.X)(),3),p=A[0],d=A[1],b=A[2],f=pn((0,i.useState)(!1),2),m=f[0],y=f[1],C=(0,i.useCallback)((function(n){return u((function(e){return un(un({},e),{},{name:n})}))}),[u]),h=mn(u,"bindings"),v=mn(u,"key-positions"),g=(0,i.useCallback)((function(n){u(n),b()}),[u,b]),x=(0,i.useCallback)((function(){r(s)}),[s,r]),j=(0,i.useMemo)((function(){return!!s.name&&s.properties["key-positions"].parsed.length>0}),[s]);return(0,B.jsx)(q.Z,{onDismiss:t,children:(0,B.jsxs)(U.Z,{dismissText:!1,classes:[E.comboPanel],children:[p&&(0,B.jsx)(V,{combo:s,onUpdate:g,onCancel:b}),m&&(0,B.jsx)(an,{binding:s.properties.bindings.parsed[0],bindingIndex:null,onCancel:function(){return y(!1)},onUpdate:function(n){h([n]),y(!1)}}),(0,B.jsx)(I.Z,{url:"https://zmk.dev/docs/features/combos",text:"ZMK Docs: Combos"}),(0,B.jsxs)("div",{className:E.combo,children:[(0,B.jsxs)("div",{className:E.heading,children:[(0,B.jsx)("div",{children:(0,B.jsx)(Y.Z,{value:s.name,validate:l,render:function(n){return(0,B.jsxs)("h5",{children:["Name: ",(0,B.jsx)("code",{children:n}),!s.name&&(0,B.jsx)("span",{style:{color:"red"},children:"*required"})]})},onUpdate:C})}),(0,B.jsx)("div",{className:E.actions,children:(0,B.jsx)(P.Z,{name:"wrench",className:"".concat(E.action),onClick:d})})]}),(0,B.jsxs)("div",{className:E.detail,children:[(0,B.jsx)("div",{className:E.comboOutput,children:(0,B.jsx)(S.Z,{binding:s.properties.bindings.parsed[0],keyWrapperProps:{className:Z.Z.unified,onClick:function(n){n.stopPropagation(),y(!0)}}})}),(0,B.jsx)(O,{keyPositions:s.properties["key-positions"].parsed,onUpdate:v})]})]}),(0,B.jsxs)("div",{style:{textAlign:"center"},children:[(0,B.jsx)(N.Z,{disabled:!j,onClick:x,children:"Create"}),(0,B.jsx)(N.Z,{onClick:t,secondary:!0,children:"Cancel"})]})]})})}var fn={name:"",labels:[],properties:{bindings:{parsed:[{value:"&none",params:[]}]},"key-positions":{parsed:[]}}};function mn(n,e){return(0,i.useCallback)((function(r){return n((function(n){return un(un({},n),{},{properties:un(un({},n.properties),{},An({},e,{parsed:r}))})}))}),[n,e])}var yn=r(94184),Cn=r.n(yn);function hn(n){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},hn(n)}function vn(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function gn(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(r),!0).forEach((function(e){xn(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function xn(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==hn(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==hn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===hn(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function En(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(n,e)||function(n,e){if(n){if("string"==typeof n)return jn(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jn(n,e):void 0}}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jn(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function Bn(){var n=(0,i.useContext)(R.c).identifiers,e=(0,a.v9)(nn.DP),r=(0,a.I0)(),t=En((0,i.useState)(null),2),l=t[0],c=t[1],s=En((0,i.useState)(null),2),u=s[0],A=s[1],p=En((0,i.useState)(null),2),d=p[0],b=p[1],f=(0,i.useCallback)((function(){b(!0)}),[b]),m=(0,i.useCallback)((function(){return b(null)}),[b]);function y(e){return(0,Q.G3)(e)||(n.includes(e)?'Cannot use existing identifier "'.concat(e,'"'):null)}var C=(0,i.useCallback)((function(n){r((0,nn.ij)({comboIndex:l,bindings:[n]})),c(null)}),[l,c,r]);return(0,B.jsxs)("div",{className:E.main,children:[null!==u&&(0,B.jsx)(V,{combo:e[u],onUpdate:function(n){return e=u,t=n,A(null),void r((0,nn.SD)({index:e,combo:t}));var e,t},onCancel:function(){return A(null)}}),d&&(0,B.jsx)(bn,gn(gn({},d.dialogProps||{}),{},{onSubmit:function(n){r((0,nn.CG)(n)),m()},onCancel:m})),null!==l&&(0,B.jsx)(an,{binding:e[l].properties.bindings.parsed[0],bindingIndex:l,onCancel:function(){return c(null)},onUpdate:C}),(0,B.jsx)("div",{className:E.header,children:(0,B.jsx)(I.Z,{url:"https://zmk.dev/docs/features/combos",text:"ZMK Docs: Combos"})}),(0,B.jsx)("div",{className:E.comboPanel,children:e.map((function(n,t){return(0,B.jsxs)("div",{className:E.combo,children:[(0,B.jsxs)("div",{className:E.heading,children:[(0,B.jsx)(Y.Z,{value:n.name,validate:y,render:function(n){return(0,B.jsx)("h5",{children:(0,B.jsx)("code",{children:n})})},onUpdate:function(n){return function(n,e){r((0,nn.l3)({index:n,name:e}))}(t,n)}}),(0,B.jsxs)("div",{className:E.actions,children:[(0,B.jsx)(P.Z,{name:"wrench",title:"Configure combo ".concat(n.name),className:E.action,onClick:function(){return A(t)}}),(0,B.jsx)(P.Z,{name:"copy",title:"Create new combo with configuration from ".concat(n.name),className:E.action,onClick:function(){return n=t,delete(r=o()(e[n])).index,r.name="",r.labels=[],void b({dialogProps:{initial:r}});var n,r}}),(0,B.jsx)(P.Z,{name:"trash-can",title:"Delete combo ".concat(n.name),className:Cn()(E.action,E.remove),onClick:function(){return n=t,void(window.confirm("Really delete combo: ".concat(e[n].name,"?"))&&r((0,nn.pd)({index:n})));var n}})]})]}),(0,B.jsxs)("div",{className:E.detail,children:[(0,B.jsx)("div",{className:E.comboOutput,children:(0,B.jsx)(S.Z,{binding:n.properties.bindings.parsed[0],keyWrapperProps:{className:Z.Z.unified,onClick:function(n){n.stopPropagation(),c(t)}}})}),(0,B.jsx)(O,{keyPositions:n.properties["key-positions"].parsed,onUpdate:function(n){return function(n,e){r((0,nn.nJ)({comboIndex:n,keyPositions:e}))}(t,n)}})]})]},t)}))}),(0,B.jsx)("div",{className:E.footer,children:(0,B.jsx)(N.Z,{onClick:f,children:"Add New Combo"})})]})}Bn.propTypes={};var wn=Bn},56803:function(n,e,r){function t(n){return function(e){e.stopPropagation(),n()}}function o(n){return function(e){n[e.key]&&n[e.key]()}}r.d(e,{s:function(){return t},w:function(){return o}})},86015:function(n,e,r){var t=r(87537),o=r.n(t),i=r(23645),a=r.n(i)()(o());a.push([n.id,'.ho3CuFFjX1VFNZJiAyVs {\n  position: relative;\n}\n.ho3CuFFjX1VFNZJiAyVs input {\n  font: inherit;\n  padding: inherit;\n  margin: inherit;\n  width: min-content;\n  box-sizing: border-box;\n}\n\n.ho3CuFFjX1VFNZJiAyVs[data-show-edit-on-hover="true"]:not(:hover) .u9J3v5ZrIbuVICzNBkRw {\n  display: none;\n}\n.ho3CuFFjX1VFNZJiAyVs[data-show-edit-on-hover="true"] .u9J3v5ZrIbuVICzNBkRw {\n  position: absolute;\n  top: 50%;\n  transform: translateY(-50%);\n  z-index: 10;\n}\n\n.cZAt44R3Yp0URA5heDw5 {\n  padding: 5px;\n  cursor: pointer;\n}\n\n.ho3CuFFjX1VFNZJiAyVs[data-show-edit-on-hover="true"] .cZAt44R3Yp0URA5heDw5 {\n  background-color: rgba(var(--dialog-bg-rgb), 0.2);\n  backdrop-filter: blur(2.5px);\n  border-radius: 4px;\n  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);\n}\n.cZAt44R3Yp0URA5heDw5[disabled] {\n  opacity: 0.5;\n  cursor: not-allowed;\n}\n\n.u9J3v5ZrIbuVICzNBkRw {\n  opacity: 0.6;\n  color: var(--key-color-base);\n}\n.u9J3v5ZrIbuVICzNBkRw:hover {\n  opacity: 1 !important;\n}\n\n.wmqWaOx7XyKADh7Kv4RZ {\n  position: absolute;\n  z-index: 10;\n  bottom: 0;\n  left: 50%;\n  transform: translate(-50%, 100%);\n  max-width: 250px;\n  width: 100%;\n\n  border-radius: 4px;\n  padding: 3px 5px;\n\n  color: white;\n  background-color: var(--error-highlight);\n  font-size: 85%;\n  font-family: sans-serif;\n\n  opacity: 0.9;\n}\n.wmqWaOx7XyKADh7Kv4RZ::before {\n  position: absolute;\n  display: block;\n  content: \' \';\n  z-index: -1;\n\n  left: 50%;\n  width: 10px;\n  height: 10px;\n\n  background-color: var(--error-highlight);\n  transform: translate(-50%, -7px) rotate(45deg);\n}\n',"",{version:3,sources:["webpack://./src/Common/editablefield.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,aAAa;EACb,gBAAgB;EAChB,eAAe;EACf,kBAAkB;EAClB,sBAAsB;AACxB;;AAEA;EACE,aAAa;AACf;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,2BAA2B;EAC3B,WAAW;AACb;;AAEA;EACE,YAAY;EACZ,eAAe;AACjB;;AAEA;EACE,iDAAiD;EACjD,4BAA4B;EAC5B,kBAAkB;EAClB,2CAA2C;AAC7C;AACA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,4BAA4B;AAC9B;AACA;EACE,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,SAAS;EACT,gCAAgC;EAChC,gBAAgB;EAChB,WAAW;;EAEX,kBAAkB;EAClB,gBAAgB;;EAEhB,YAAY;EACZ,wCAAwC;EACxC,cAAc;EACd,uBAAuB;;EAEvB,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,WAAW;;EAEX,SAAS;EACT,WAAW;EACX,YAAY;;EAEZ,wCAAwC;EACxC,8CAA8C;AAChD",sourcesContent:['.container {\n  position: relative;\n}\n.container input {\n  font: inherit;\n  padding: inherit;\n  margin: inherit;\n  width: min-content;\n  box-sizing: border-box;\n}\n\n.container[data-show-edit-on-hover="true"]:not(:hover) .edit {\n  display: none;\n}\n.container[data-show-edit-on-hover="true"] .edit {\n  position: absolute;\n  top: 50%;\n  transform: translateY(-50%);\n  z-index: 10;\n}\n\n.buttonIcon {\n  padding: 5px;\n  cursor: pointer;\n}\n\n.container[data-show-edit-on-hover="true"] .buttonIcon {\n  background-color: rgba(var(--dialog-bg-rgb), 0.2);\n  backdrop-filter: blur(2.5px);\n  border-radius: 4px;\n  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);\n}\n.buttonIcon[disabled] {\n  opacity: 0.5;\n  cursor: not-allowed;\n}\n\n.edit {\n  opacity: 0.6;\n  color: var(--key-color-base);\n}\n.edit:hover {\n  opacity: 1 !important;\n}\n\n.error {\n  position: absolute;\n  z-index: 10;\n  bottom: 0;\n  left: 50%;\n  transform: translate(-50%, 100%);\n  max-width: 250px;\n  width: 100%;\n\n  border-radius: 4px;\n  padding: 3px 5px;\n\n  color: white;\n  background-color: var(--error-highlight);\n  font-size: 85%;\n  font-family: sans-serif;\n\n  opacity: 0.9;\n}\n.error::before {\n  position: absolute;\n  display: block;\n  content: \' \';\n  z-index: -1;\n\n  left: 50%;\n  width: 10px;\n  height: 10px;\n\n  background-color: var(--error-highlight);\n  transform: translate(-50%, -7px) rotate(45deg);\n}\n'],sourceRoot:""}]),a.locals={container:"ho3CuFFjX1VFNZJiAyVs",edit:"u9J3v5ZrIbuVICzNBkRw",buttonIcon:"cZAt44R3Yp0URA5heDw5",error:"wmqWaOx7XyKADh7Kv4RZ"},e.Z=a},78207:function(n,e,r){var t=r(87537),o=r.n(t),i=r(23645),a=r.n(i)()(o());a.push([n.id,'.pwXbGORsYKqyOPBm9_dW {\n  padding-bottom: 60px;\n}\n\n.FDsUz791VURN5GgqawOQ, .MhI51kJR50XISY6jcLAw {\n  width: 550px;\n  margin: 1px auto;\n}\n.MhI51kJR50XISY6jcLAw {\n  text-align: center;\n  margin-top: 10px;\n  padding-top: 20px;\n  border-top: 2px solid var(--key-bg-base);\n}\n\n.Gy0KZGCgOeVminAfggFQ {\n  cursor: pointer;\n  background-color: var(--key-bg-base);\n}\n.Gy0KZGCgOeVminAfggFQ:hover {\n  border: 4px solid var(--selection);\n  box-sizing: border-box;\n}\n\n.Ld9cVdtpS_DpbEifyX9Y {\n  background-color: var(--selection);\n}\n.Ld9cVdtpS_DpbEifyX9Y:hover {\n  background-color: var(--hover-selection);\n}\n\n.mqpJ7uHAMKxvORoOIPFK {\n  max-width: 450px;\n  margin: 0 auto;\n}\n\n.BVucwy4AZCyl7GyivzMn {\n  display: flex;\n  justify-content: space-between;\n  border-bottom: 2px solid var(--key-bg-base);\n  margin: 5px 0;\n}\n\n.U6g0njWjBrtb_I3XhAeV {\n  cursor: pointer;\n  padding: 5px;\n  opacity: 0.6;\n}\n.U6g0njWjBrtb_I3XhAeV:hover {\n  opacity: 1;\n}\n\n.CROhsBLtunQ2BbfWdkQw {\n  margin: 10px 0 40px;\n}\n\n.CROhsBLtunQ2BbfWdkQw .MhA4fXXuaZ1iPvv05w4m {\n  display: flex;\n  justify-content: space-evenly;\n  align-items: center;\n  gap: 20px;\n}\n\n.CROhsBLtunQ2BbfWdkQw h5 {\n  margin: 0;\n}\n\n.vujYcgQjiN4BGp37FMUH {\n  color: var(--key-color-base);\n}\n\n.uh2yPWyfEOZtgXo2_KtU {\n  color: var(--delete);\n}\n\n.NAB1EN6_pcYIy5Db9XnC {\n  display: none !important;\n}\n.NAB1EN6_pcYIy5Db9XnC:hover {\n  color: white;\n  cursor: pointer;\n}\n.kYn8brsFgEaf61oQyv4d:hover .NAB1EN6_pcYIy5Db9XnC {\n  display: flex !important;\n  position: absolute;\n  right: -48px;\n  transform: scale(0.5);\n}\n\n.NGxnhfSJaJ9FNu3hlBfc.NAB1EN6_pcYIy5Db9XnC,\n.NGxnhfSJaJ9FNu3hlBfc.GXgG_IaQTricqThqzsKe > * {\n  background-color: sandybrown;\n  color: white;\n}\n.NGxnhfSJaJ9FNu3hlBfc.NAB1EN6_pcYIy5Db9XnC {\n  display: flex;\n}\n\n.fljdvcebOv1gbKZpf0vW {\n  margin: 10px 0;\n  display: flex;\n  align-items: center;\n}\n\n.fljdvcebOv1gbKZpf0vW label {\n  display: inline-block;\n  width: 120px;\n  text-align: right;\n  margin-right: 10px;\n}\n\n.bnN6JCit0RcjdQiqzw8w {\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n}\n.bnN6JCit0RcjdQiqzw8w li {\n  cursor: pointer;\n  display: inline-block;\n  padding: 5px 10px;\n  margin: 5px;\n  border-radius: 30px;\n  background-color: var(--key-bg-base);\n}\n.bnN6JCit0RcjdQiqzw8w li[data-selected="true"] {\n  background-color: var(--selection);\n  color: var(--key-color-hover);\n}\n.bnN6JCit0RcjdQiqzw8w li:hover {\n  background-color: var(--hover-selection);\n  color: var(--key-color-hover);\n}\n\n.NpLEYrC32KQ4rUx9hUFJ {\n  background-color: var(--key-bg-base);\n  border-radius: 30px;\n  color: var(--key-color-base);\n  font-size: 80%;\n  text-align: center;\n  padding: 5px;\n  position: absolute;\n  bottom: -40px;\n  left: 50%;\n  transform: translate(-50%, 0);\n  width: 110%;\n\n  pointer-events: none;\n  transition: opacity ease-in-out .5s;\n}\n\n.l2gtE1XKS63R5TM5unip { position: relative }\n.l2gtE1XKS63R5TM5unip:hover .NpLEYrC32KQ4rUx9hUFJ { opacity: 0.25 }\n',"",{version:3,sources:["webpack://./src/Keyboard/Combos/styles.module.css"],names:[],mappings:"AAAA;EACE,oBAAoB;AACtB;;AAEA;EACE,YAAY;EACZ,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,iBAAiB;EACjB,wCAAwC;AAC1C;;AAEA;EACE,eAAe;EACf,oCAAoC;AACtC;AACA;EACE,kCAAkC;EAClC,sBAAsB;AACxB;;AAEA;EACE,kCAAkC;AACpC;AACA;EACE,wCAAwC;AAC1C;;AAEA;EACE,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,2CAA2C;EAC3C,aAAa;AACf;;AAEA;EACE,eAAe;EACf,YAAY;EACZ,YAAY;AACd;AACA;EACE,UAAU;AACZ;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,6BAA6B;EAC7B,mBAAmB;EACnB,SAAS;AACX;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,wBAAwB;AAC1B;AACA;EACE,YAAY;EACZ,eAAe;AACjB;AACA;EACE,wBAAwB;EACxB,kBAAkB;EAClB,YAAY;EACZ,qBAAqB;AACvB;;AAEA;;EAEE,4BAA4B;EAC5B,YAAY;AACd;AACA;EACE,aAAa;AACf;;AAEA;EACE,cAAc;EACd,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;EACrB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,qBAAqB;EACrB,SAAS;EACT,UAAU;AACZ;AACA;EACE,eAAe;EACf,qBAAqB;EACrB,iBAAiB;EACjB,WAAW;EACX,mBAAmB;EACnB,oCAAoC;AACtC;AACA;EACE,kCAAkC;EAClC,6BAA6B;AAC/B;AACA;EACE,wCAAwC;EACxC,6BAA6B;AAC/B;;AAEA;EACE,oCAAoC;EACpC,mBAAmB;EACnB,4BAA4B;EAC5B,cAAc;EACd,kBAAkB;EAClB,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,SAAS;EACT,6BAA6B;EAC7B,WAAW;;EAEX,oBAAoB;EACpB,mCAAmC;AACrC;;AAEA,wBAAiB,mBAAmB;AACpC,oDAAwC,cAAc",sourcesContent:['.main {\n  padding-bottom: 60px;\n}\n\n.header, .footer {\n  width: 550px;\n  margin: 1px auto;\n}\n.footer {\n  text-align: center;\n  margin-top: 10px;\n  padding-top: 20px;\n  border-top: 2px solid var(--key-bg-base);\n}\n\n.selectable {\n  cursor: pointer;\n  background-color: var(--key-bg-base);\n}\n.selectable:hover {\n  border: 4px solid var(--selection);\n  box-sizing: border-box;\n}\n\n.highlight {\n  background-color: var(--selection);\n}\n.highlight:hover {\n  background-color: var(--hover-selection);\n}\n\n.comboPanel {\n  max-width: 450px;\n  margin: 0 auto;\n}\n\n.heading {\n  display: flex;\n  justify-content: space-between;\n  border-bottom: 2px solid var(--key-bg-base);\n  margin: 5px 0;\n}\n\n.action {\n  cursor: pointer;\n  padding: 5px;\n  opacity: 0.6;\n}\n.action:hover {\n  opacity: 1;\n}\n\n.combo {\n  margin: 10px 0 40px;\n}\n\n.combo .detail {\n  display: flex;\n  justify-content: space-evenly;\n  align-items: center;\n  gap: 20px;\n}\n\n.combo h5 {\n  margin: 0;\n}\n\n.edit {\n  color: var(--key-color-base);\n}\n\n.remove {\n  color: var(--delete);\n}\n\n.addComboInput {\n  display: none !important;\n}\n.addComboInput:hover {\n  color: white;\n  cursor: pointer;\n}\n.comboInputList:hover .addComboInput {\n  display: flex !important;\n  position: absolute;\n  right: -48px;\n  transform: scale(0.5);\n}\n\n.active.addComboInput,\n.active.comboInput > * {\n  background-color: sandybrown;\n  color: white;\n}\n.active.addComboInput {\n  display: flex;\n}\n\n.field {\n  margin: 10px 0;\n  display: flex;\n  align-items: center;\n}\n\n.field label {\n  display: inline-block;\n  width: 120px;\n  text-align: right;\n  margin-right: 10px;\n}\n\n.layerList {\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n}\n.layerList li {\n  cursor: pointer;\n  display: inline-block;\n  padding: 5px 10px;\n  margin: 5px;\n  border-radius: 30px;\n  background-color: var(--key-bg-base);\n}\n.layerList li[data-selected="true"] {\n  background-color: var(--selection);\n  color: var(--key-color-hover);\n}\n.layerList li:hover {\n  background-color: var(--hover-selection);\n  color: var(--key-color-hover);\n}\n\n.floatingMessage {\n  background-color: var(--key-bg-base);\n  border-radius: 30px;\n  color: var(--key-color-base);\n  font-size: 80%;\n  text-align: center;\n  padding: 5px;\n  position: absolute;\n  bottom: -40px;\n  left: 50%;\n  transform: translate(-50%, 0);\n  width: 110%;\n\n  pointer-events: none;\n  transition: opacity ease-in-out .5s;\n}\n\n.comboInputMap { position: relative }\n.comboInputMap:hover .floatingMessage { opacity: 0.25 }\n'],sourceRoot:""}]),a.locals={main:"pwXbGORsYKqyOPBm9_dW",header:"FDsUz791VURN5GgqawOQ",footer:"MhI51kJR50XISY6jcLAw",selectable:"Gy0KZGCgOeVminAfggFQ",highlight:"Ld9cVdtpS_DpbEifyX9Y",comboPanel:"mqpJ7uHAMKxvORoOIPFK",heading:"BVucwy4AZCyl7GyivzMn",action:"U6g0njWjBrtb_I3XhAeV",combo:"CROhsBLtunQ2BbfWdkQw",detail:"MhA4fXXuaZ1iPvv05w4m",edit:"vujYcgQjiN4BGp37FMUH",remove:"uh2yPWyfEOZtgXo2_KtU",addComboInput:"NAB1EN6_pcYIy5Db9XnC",comboInputList:"kYn8brsFgEaf61oQyv4d",active:"NGxnhfSJaJ9FNu3hlBfc",comboInput:"GXgG_IaQTricqThqzsKe",field:"fljdvcebOv1gbKZpf0vW",layerList:"bnN6JCit0RcjdQiqzw8w",floatingMessage:"NpLEYrC32KQ4rUx9hUFJ",comboInputMap:"l2gtE1XKS63R5TM5unip"},e.Z=a}}]);
//# sourceMappingURL=ComboEditorTab.fb7b39eae888f425ecc2.js.map