text: import { translate } from '../../../../utils/lang/i18n';
  
  Blockly.Blocks.check_sell = {
      init() {
          this.jsonInit({
              message0       : translate('Sell is available'),
              output         : 'Boolean',
              outputShape    : Blockly.OUTPUT_SHAPE_HEXAGONAL,
              colour         : Blockly.Colours.Binary.colour,
              colourSecondary: Blockly.Colours.Binary.colourSecondary,
              colourTertiary : Blockly.Colours.Binary.colourTertiary,
              tooltip        : translate('True if sell at market is available'),
          });
      },
      onchange(event) {
          if (!this.workspace || this.isInFlyout || this.workspace.isDragging()) {
              return;
          }
  
          if (event.type === Blockly.Events.END_DRAG) {
              if (this.isDescendantOf('during_purchase')) {
                  if (this.disabled) {
                      this.setDisabled(false);
                  }
              } else if (!this.disabled) {
                  this.setDisabled(true);
              }
          }
      },
  };
  
  Blockly.JavaScript.check_sell = () => {
      const code = 'Bot.isSellAvailable()';
      return [code, Blockly.JavaScript.ORDER_ATOMIC];
  };
  