  PCMSK0 = PCMSK0copy;
#endif
#ifdef EIMSK
  EIMSK = EIMSKcopy;
#endif
#ifdef EECR
  EECR = EECRcopy;
#endif

  SREG = SREGcopy;

#ifdef WDTCSR
  WDTCSR &= ~_BV(WDIE);
#else
  WDTCR &= ~_BV(WDIE);
#endif
}

void NarcolepticClass::sleep(uint8_t wdt_period) {
  sleepAdv(wdt_period,SLEEP_MODE_PWR_DOWN,0,0,0,0,0);
}

// uncalibrated delay
void NarcolepticClass::delay(uint32_t milliseconds) { // milliseconds is expected to be >= 16
  millisCounter += milliseconds;
  uint32_t sleep_periods = milliseconds / 16;

  // <avr/wdt.h> defines :
  // WDTO_15MS  = 0 = 16ms
  // WDTO_30MS  = 1 = 32ms
  // WDTO_60MS  = 2 = 64ms
  // WDTO_120MS = 3 = 128ms
  // WDTO_250MS = 4 = 256ms
  // WDTO_500MS = 5 = 512ms
  // WDTO_1S    = 6 = 1024ms
  // WDTO_2S    = 7 = 2048ms
  // WDTO_4S    = 8 = 4096ms // implemented when WDP3 exists
  // WDTO_8S    = 9 = 8192ms // implemented when WDP3 exists
  uint8_t i=WDTO_15MS;
  while (sleep_periods > 0) {
#ifdef WDP3
    if (i<WDTO_8S) {
#else
    if (i<WDTO_2S) {
#endif
      if (sleep_periods & 1) sleep(i);
      i++;
      sleep_periods >>= 1;
    } else {
      sleep(i);
      sleep_periods--;
    }
  }
}

// calibrated delay
void NarcolepticClass::delayCal(uint32_t milliseconds, uint8_t run_calibration) { // milliseconds is expected to be >= 16
  millisCounter += milliseconds;
  uint32_t microseconds = milliseconds * 1000L;
  static uint16_t watchdogTime_us = 16000;
  if (run_calibration) {
    watchdogTime_us = calibrate(); // Takes approx. 16ms, CPU is in SLEEP_MODE_IDLE during this time
    if (microseconds >= watchdogTime_us) {
      microseconds -= watchdogTime_us;
    }
  }
  uint32_t sleep_periods = microseconds / watchdogTime_us;

  // <avr/wdt.h> defines :
  // WDTO_15MS  = 0 = 16ms
  // WDTO_30MS  = 1 = 32ms
  // WDTO_60MS  = 2 = 64ms
  // WDTO_120MS = 3 = 128ms
  // WDTO_250MS = 4 = 256ms
  // WDTO_500MS = 5 = 512ms
  // WDTO_1S    = 6 = 1024ms
  // WDTO_2S    = 7 = 2048ms
  // WDTO_4S    = 8 = 4096ms // implemented when WDP3 exists
  // WDTO_8S    = 9 = 8192ms // implemented when WDP3 exists
  uint8_t i=WDTO_15MS;
  while (sleep_periods > 0) {
#ifdef WDP3
    if (i<WDTO_8S) {
#else
    if (i<WDTO_2S) {
#endif
      if (sleep_periods & 1) sleep(i);
      i++;
      sleep_periods >>= 1;
    } else {
      sleep(i);
      sleep_periods--;
    }
  }
}

uint16


erator()(const dt_qint32& src) const {
        float tmp = src.as_int32() * this->scale_src;
        tmp = tmp * std::max(std::min(tmp + 3.f, 6.f), 0.f) / 6.f;
        tmp *= this->scale_dst;
        return QConverter::convert<dt_qint8, float>(tmp);
    }
};

template <>
struct HSwishOp<dt_qint32, dt_qint8> : HSwishOpBase<dt_qint32, dt_qint8> {
    using HSwishOpBase::HSwishOpBase;
    using HSwishOpBase::operator();
    constexpr static size_t SIMD_WIDTH = GI_SIMD_LEN_BYTE / sizeof(int32_t);

    void operator()(const GI_INT32_V2_t& vsrc, dt_qint8* dst) const {
        GiStoreLowInt8(reinterpret_cast<int8_t*>(dst), operator()(vsrc));
    }

    GI_INT8_t operator()(const GI_INT32_V2_t& vsrc) const {
        auto vitem0 = GiMultiplyFloat32(
                GiCastToFloat32(GiGetSubVectorInt32V2(vsrc, 0)),
                GiFixLenType2GiFloat32Type(this->vscale_src));
        auto vitem1 = GiMultiplyFloat32(
                GiCastToFloat32(GiGetSubVectorInt32V2(vsrc, 1)),
                GiFixLenType2GiFloat32Type(this->vscale_src));

        H_SWISH_KERN_FALLBACK(Float32, vitem0, vitem1);
        vitem0 =
                GiMultiplyFloat32(vitem0, GiFixLenType2GiFloat32Type(this->vscale_dst));
        vitem1 =
                GiMultiplyFloat32(vitem1, GiFixLenType2GiFloat32Type(this->vscale_dst));
        GI_FLOAT32_V2_t tmp;
        GiSetSubVectorFloat32V2(tmp, 0, vitem0);
        GiSetSubVectorFloat32V2(tmp, 1, vitem1);

        return QConverter::convert<GI_INT8_t, GI_FLOAT32_V2_t>(tmp);
    }
};

}  // namespace fallback
}  // namespace megdnn

#include "src/fallback/elemwise_helper/kimpl/kern_macro_epilogue.h"
// vim: syntax=cpp.doxygen


ല് നിന്ന് അവന് ഉണ്ടാക്കി."
  },
  {
    "surah_number": 32,
    "verse_number": 9,
    "content":
        "പിന്നെ അവനെ ശരിയായ രൂപത്തിലാക്കുകയും, തന്‍റെ വകയായുള്ള ആത്മാവ് അവനില് ഊതുകയും ചെയ്തു. നിങ്ങള്‍ക്കവന് കേള്‍വിയും കാഴ്ചകളും ഹൃദയങ്ങളും ഉണ്ടാക്കിത്തരികയും ചെയ്തു. കുറച്ച് മാത്രമേ നിങ്ങള് നന്ദികാണിക്കുന്നുള്ളൂ."
  },
  {
    "surah_number": 32,
    "verse_number": 10,
    "content":
        "അവര് (അവിശ്വാസികള്) പറഞ്ഞു: ഞങ്ങള് ഭൂമിയില് ലയിച്ച് അപ്രത്യക്ഷരായാല് പോലും ഞങ്ങള് പുതുതായി സൃഷ്ടിക്കപ്പെടുമെന്നോ? അല്ല, അവര് തങ്ങളുടെ രക്ഷിതാവിനെ കണ്ടുമുട്ടുന്നതിനെ നിഷേധിക്കുന്നവരാകുന്നു."
  },
  {
    "surah_number": 32,
    "verse_number": 11,
    "content":
        "(നബിയേ,) പറയുക: നിങ്ങളുടെ കാര്യത്തില് ഏല്‍പിക്കപ്പെട്ട മരണത്തിന്‍റെ മലക്ക് നിങ്ങളെ മര


 located at
//
//     http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/amazon-vpc-resource-controller-k8s/pkg/k8s/wrapper.go

// Package mock_k8s is a generated GoMock package.
package mock_k8s

import (
	reflect "reflect"

	v1alpha1 "github.com/aws/amazon-vpc-cni-k8s/pkg/apis/crd/v1alpha1"
	v1alpha10 "github.com/aws/amazon-vpc-resource-controller-k8s/apis/vpcresources/v1alpha1"
	gomock "github.com/golang/mock/gomock"
	v1 "k8s.io/api/apps/v1"
	v10 "k8s.io/api/core/v1"
	v11 "k8s.io/api/events/v1"
	runtime "k8s.io/apimachinery/pkg/runtime"
	types "k8s.io/apimachinery/pkg/types"
	client "sigs.k8s.io/controller-runtime/pkg/client"
)

// MockK8sWrapper is a mock of K8sWrapper interface.
type MockK8sWrapper struct {
	ctrl     *gomock.Controller
	recorder *MockK8sWrapperMockRecorder
}

// MockK8sWrapperMockRecorder is the mock recorder for MockK8sWrapper.
type MockK8sWrapperMockRecorder struct {
	mock *MockK8sWrapper
}

// NewMockK8sWrapper creates a new mock instance.
func NewMockK8sWrapper(ctrl *gomock.Controller) *MockK8sWrapper {
	mock := &MockK8sWrapper{ctrl: ctrl}
	mock.recorder = &MockK8sWrapperMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockK8sWrapper) EXPECT() *MockK8sWrapperMockRecorder {
	return m.recorder
}

// AddLabelToManageNode mocks base method.
func (m *MockK8sWrapper) AddLabelToManageNode(node *v10.Node, labelKey, labelValue string) (bool, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "AddLabelToManageNode", node, labelKey, labelValue)
	ret0, _ := ret[0].(bool)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// AddLabelToManageNode indicates an expected call of AddLabelToManageNode.
func (mr *MockK8sWrapperMockRecorder) AddLabelToManageNode(node, labelKey, labelValue interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLabelToManageNode", reflect.TypeOf((*MockK8sWrapper)(nil).AddLabelToManageNode), node, labelKey, labelValue)
}

// AdvertiseCapacityIfNotSet mocks base method.
func (m *MockK8sWrapper) AdvertiseCapacityIfNotSet(nodeName, resourceName string, capacity int) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "AdvertiseCapacityIfNotSet", nodeName, resourceName, capacity)
	ret0, _ := ret[0].(error)
	return ret0
}

// AdvertiseCapacityIfNotSet indicates an expected call of AdvertiseCapacityIfNotSet.
func (mr *MockK8sWrapperMockRecorder) AdvertiseCapacityIfNo


   this.data.array[index2 + 1] = y;
    this.data.array[index2 + 2] = z;
    return this;
  }
  setXYZW(index2, x, y, z, w) {
    index2 = index2 * this.data.stride + this.offset;
    if (this.normalized) {
      x = normalize(x, this.array);
      y = normalize(y, this.array);
      z = normalize(z, this.array);
      w = normalize(w, this.array);
    }
    this.data.array[index2 + 0] = x;
    this.data.array[index2 + 1] = y;
    this.data.array[index2 + 2] = z;
    this.data.array[index2 + 3] = w;
    return this;
  }
  clone(data) {
    if (data === void 0) {
      console.log(
        "THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.",
      );
      const array = [];
      for (let i4 = 0; i4 < this.count; i4++) {
        const index2 = i4 * this.data.stride + this.offset;
        for (let j = 0; j < this.itemSize; j++) {
          array.push(this.data.array[index2 + j]);
        }
      }
      return new BufferAttribute(
        new this.array.constructor(array),
        this.itemSize,
        this.normalized,
      );
    } else {
      if (data.interleavedBuffers === void 0) {
        data.interleavedBuffers = {};
      }
      if (data.interleavedBuffers[this.data.uuid] === void 0) {
        data.interleavedBuffers[this.data.uuid] = this.data.clone(data);
      }
      return new InterleavedBufferAttribute(
        data.interleavedBuffers[this.data.uuid],
        this.itemSize,
        this.offset,
        this.normalized,
      );
    }
  }
  toJSON(data) {
    if (data === void 0) {
      console.log(
        "THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.",
      );
      const array = [];
      for (let i4 = 0; i4 < this.count; i4++) {
        const index2 = i4 * this.data.stride + this.offset;
        for (let j = 0; j < this.itemSize; j++) {
          array.push(this.data.array[index2 + j]);
        }
      }
      return {
        itemSize: this.itemSize,
        type: this.array.constructor.name,
        array,
        normalized: this.normalized,
      };
    } else {
      if (data.interleavedBuffers === void 0) {
        data.interleavedBuffers = {};
      }
      if (data.interleavedBuffers[this.data.uuid] === void 0) {
        data.interleavedBuffers[this.data.uuid] = this.data.toJSON(data);
      }
      return {
        isInterleavedBufferAttribute: true,
        itemSize: this.itemSize,
        data: this.data.uuid,
        offset: this.offset,
        normalized: this.normalized,
      };
    }
  }
};
var SpriteMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.isSpriteMaterial = true;
    this.type = "SpriteMaterial


in-dependencies/")
    }

    configurations.configureEach {
        exclude(group = "com.jetbrains.rd")
        exclude(group = "com.github.jetbrains", module = "jetCheck")
        exclude(group = "com.jetbrains.intellij.platform", module = "wsl-impl")
        exclude(group = "org.roaringbitmap")
        exclude(group = "com.jetbrains.infra")
        exclude(group = "org.jetbrains.teamcity")
        exclude(group = "org.roaringbitmap")
        exclude(group = "ai.grazie.spell")
        exclude(group = "ai.grazie.model")
        exclude(group = "ai.grazie.utils")
        exclude(group = "ai.grazie.nlp")

        // We have a transitive dependency on this due to Kermit, but need the fixed version to support Java 8
        resolutionStrategy.force("co.touchlab:stately-collections:${libs.versions.stately.get()}")
    }
}
subprojects {
    val GROUP: String by project
    val LIBRARY_VERSION: String by project

    group = GROUP
    version = LIBRARY_VERSION
}

tasks.getByName<Delete>("clean") {
    delete(rootProject.layout.buildDirectory)
}

// Merges individual module docs into a single HTML output
dependencies {
    dokka(project(":core:"))
    dokka(project(":compose:"))
    dokka(project(":integrations:room"))
    dokka(project(":integrations:sqldelight"))
    dokka(project(":integrations:supabase"))
}

dokka {
    moduleName.set("PowerSync Kotlin")
}

develocity {
    val isPowerSyncCI = System.getenv("GITHUB_REPOSITORY") == "powersync-ja/powersync-kotlin"

    buildScan {
        // We can't know if everyone running this build has accepted the TOS, but we've accepted
        // them for our CI.
        if (isPowerSyncCI) {
            termsOfUseUrl.set("https://gradle.com/help/legal-terms-of-use")
            termsOfUseAgree.set("yes")
        }

        // Only upload build scan if the --scan parameter is set
        publishing.onlyIf { false }
    }
}

// Serve the generated Dokka documentation using a simple HTTP server
// File changes are not watched here
tasks.register("serveDokka") {
    group = "dokka"
    dependsOn("dokkaGenerate")
    val rootProvider = layout.buildDirectory.dir("dokka/html")

    doLast {
        val root = rootProvider.get().asFile
        val server = HttpServer.create(InetSocketAddress(0), 0)

        val handler =
            com.sun.net.httpserver.HttpHandler { exchange: HttpExchange ->
                val rawPath = exchange.requestURI.path
                val cleanPath = URLDecoder.decode(rawPath.removePrefix("/"), "UTF-8")
                val requestedFile = File(root, cleanPath)

                val file =
                    when {
                        requestedFile.exists() && !requestedFile.isDirectory -> requestedFile
                        else -> File(root, "index.html") // fallback
                    }

                val contentType =
                    Files.probeContentType(file.toPath()) ?: "application/octet-stream"
                val bytes = file.readBytes()
                exchange.responseHeaders.add("Content-Type", contentType)
                exchange.sendResponseHeaders(200, bytes.size.toLong())
                exchange.responseBody.use { it.write(bytes) }
            }

        server.createContext("/", handler)
        server.executor = null
        server.start()

        println("📘 Serving Dokka docs at http://localhost:${server.address.port}/")
        println("Press Ctrl+C to stop.")

        // Keep the task alive
        Thread.currentThread().join()
    }
}
package com.powersync.demos.components

import androidx.compose.foundation.layout.Box
import androidx


/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 1999 - 2018 Intel Corporation. */

#ifndef _E1000_DEFINES_H_
#define _E1000_DEFINES_H_

/* Number of Transmit and Receive Descriptors must be a multiple of 8 */
#define REQ_TX_DESCRIPTOR_MULTIPLE	8
#define REQ_RX_DESCRIPTOR_MULTIPLE	8

/* IVAR valid bit */
#define E1000_IVAR_VALID	0x80

/* Receive Descriptor bit definitions */
#define E1000_RXD_STAT_DD	0x01    /* Descriptor Done */
#define E1000_RXD_STAT_EOP	0x02    /* End of Packet */
#define E1000_RXD_STAT_IXSM	0x04    /* Ignore checksum */
#define E1000_RXD_STAT_VP	0x08    /* IEEE VLAN Packet */
#define E1000_RXD_STAT_UDPCS	0x10    /* UDP xsum calculated */
#define E1000_RXD_STAT_TCPCS	0x20    /* TCP xsum calculated */
#define E1000_RXD_STAT_IPCS	0x40    /* IP xsum calculated */
#define E1000_RXD_ERR_SE	0x02    /* Symbol Error */
#define E1000_RXD_SPC_VLAN_MASK	0x0FFF  /* VLAN ID is in lower 12 bits */

#define E1000_RXDEXT_STATERR_LB	0x00040000
#define E1000_RXDEXT_STATERR_CE	0x01000000
#define E1000_RXDEXT_STATERR_SE	0x02000000
#define E1000_RXDEXT_STATERR_SEQ	0x04000000
#define E1000_RXDEXT_STATERR_CXE	0x10000000
#define E1000_RXDEXT_STATERR_TCPE	0x20000000
#define E1000_RXDEXT_STATERR_IPE	0x40000000
#define E1000_RXDEXT_STATERR_RXE	0x80000000

/* Same mask, but for extended and packet split descriptors */
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \
	E1000_RXDEXT_STATERR_CE  | \
	E1000_RXDEXT_STATERR_SE  | \
	E1000_RXDEXT_STATERR_SEQ | \
	E1000_RXDEXT_STATERR_CXE | \
	E1000_RXDEXT_STATERR_RXE)

/* Device Control */
#define E1000_CTRL_RST		0x04000000  /* Global reset */

/* Device Status */
#define E1000_STATUS_FD		0x00000001      /* Full duplex.0=half,1=full */
#define E1000_STATUS_LU		0x00000002      /* Link up.0=no,1=link */
#define E1000_STATUS_TXOFF	0x00000010      /* transmission paused */
#define E1000_STATUS_SPEED_10	0x00000000      /* Speed 10Mb/s */
#define E1000_STATUS_SPEED_100	0x00000040      /* Speed 100Mb/s */
#define E1000_STATUS_SPEED_1000	0x00000080      /* Speed 1000Mb/s */

#define SPEED_10	10
#define SPEED_100	100
#define SPEED_1000	1000
#define HALF_DUPLEX	1
#define FULL_DUPLEX	2

/* Transmit Descriptor bit definitions */
#define E1000_TXD_POPTS_IXSM	0x01       /* Insert IP checksum */
#define E1000_TXD_POPTS_TXSM	0x02       /* Insert TCP/UDP checksum */
#define E1000_TXD_CMD_DEXT	0x20000000 /* Desc extension (0 = legacy) */
#define E1000_TXD_STAT_DD	0x00000001 /* Desc Done */

#define MAX_JUMBO_FRAME_SIZE		0x3F00
#define MAX_STD_JUMBO_FRAME_SIZE	9216

/* 802.1q VLAN Packet Size */
#define VLAN_TAG_SIZE		4    /* 802.3ac tag (not DMA'd) */

/* Error Codes */
#define E1000_SUCCESS		0
#define E1000_ERR_CONFIG	3
#define E1000_ERR_MAC_INIT	5
#define E1000_ERR_MBX		15

/* SRRCTL bit definitions */
#define E1000_SRRCTL_BSIZEPKT_SHIFT		10 /* Shift _right_ */
#define E1000_SRRCTL_BSIZEHDRSIZE_MASK		0x00000F00
#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT		2  /* Shift _left_ */
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF	0x02000000
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS	0x0A000000
#define E1000_SRRCTL_DESCTYPE_MASK		0x0E000000
#define E1000_SRRCTL_DROP_EN			0x80000000

#define E1000_SRRCTL_BSIZEPKT_MASK	0x0000007F
#define E1000_SRRCTL_BSIZEHDR_MASK	0x00003F00

/* Additional Descriptor Control definitions */
#define E1000_TXDCTL_QUEUE_ENABLE	0x02000000 /* Enable specific Tx Que */
#define E1000_RXDCTL_QUEUE_ENABLE	0x02000000 /* Enable specific Rx Que */

/* Direct Cache Access (DCA) definitions */
#define E1000_DCA_TXCTRL_TX_WB_RO_EN	BIT(11) /* Tx Desc writeback RO bit */

#define E1000_VF_INIT_TIMEOUT	200 /* Number of retries to clear RSTI */

#endif /* _E1000_DEFINES_H_ */


DAY_OF_MONTH);
			endDay = LIST_VIEW_ENDING_DAY;
		}
        else
		if (SHOW_DAY.equals(mode))
		{
			// To show the day, we only use one date for start/end.
			TimeBreakdown breakDown =
				TimeService.newTime().breakdownLocal();

			startYear = breakDown.getYear();
			endYear = startYear;

			startMonth = breakDown.getMonth();
			endMonth = startMonth;

			startDay = breakDown.getDay();
			endDay = startDay;
		}
		else
		if (SHOW_WEEK.equals(mode))
		{
			GregorianCalendar calStart =
				new GregorianCalendar(TimeService.getLocalTimeZone(), rb.getLocale());
			GregorianCalendar calEnd =
				(GregorianCalendar) calStart.clone();

			// Set the first/last days of the week.
			calStart.set(GregorianCalendar.DAY_OF_WEEK, calStart.getFirstDayOfWeek());
			calEnd.set(GregorianCalendar.DAY_OF_WEEK, calStart.getFirstDayOfWeek()+6);

			startYear = calStart.get(GregorianCalendar.YEAR);
			endYear = calEnd.get(GregorianCalendar.YEAR);

			startMonth = calStart.get(GregorianCalendar.MONTH) + 1;
			endMonth = calEnd.get(GregorianCalendar.MONTH) + 1;

			startDay = calStart.get(GregorianCalendar.DAY_OF_MONTH);
			endDay = calEnd.get(GregorianCalendar.DAY_OF_MONTH);
		}
		else
		if (SHOW_MONTH.equals(mode))
		{
			GregorianCalendar calStart =
				new GregorianCalendar(
					TimeService.getLocalTimeZone());
			GregorianCalendar calEnd =
				(GregorianCalendar) calStart.clone();

			// Set the first/last days of the month.
			calStart.set(GregorianCalendar.DAY_OF_MONTH, 1);
			calEnd.set(
				GregorianCalendar.DAY_OF_MONTH,
				calStart.getMaximum(
					GregorianCalendar.DAY_OF_MONTH));

			startYear = calStart.get(GregorianCalendar.YEAR);
			endYear = calEnd.get(GregorianCalendar.YEAR);

			startMonth = calStart.get(GregorianCalendar.MONTH) + 1;
			endMonth = calEnd.get(GregorianCalendar.MONTH) + 1;

			startDay = calStart.get(GregorianCalendar.DAY_OF_MONTH);
			endDay = calEnd.get(GregorianCalendar.DAY_OF_MONTH);
		}
		else
		if (SHOW_YEAR.equals(mode))
		{
			TimeBreakdown breakDown =
				TimeService.newTime().breakdownLocal();

			startYear = breakDown.getYear();
			endYear = startYear;

			startMonth = 1;
			endMonth = 12;

			startDay = 1; // January 1
			endDay = 31; // December 31st
		}
		else
		if (SHOW_CUSTOM_RANGE.equals(mode))
		{
			TimeBreakdown startBreakdown =
				startingListViewDate.breakdownLocal();
			TimeBreakdown endBreakdown =
				endingListViewDate.breakdownLocal();

			startYear = startBreakdown.getYear();
			endYear = endBreakdown.getYear();

			startMonth = startBreakdown.getMonth();
			endMonth = endBreakdown.getMonth();

			startDay = startBreakdown.getDay();
			endDay = endBreakdown.getDay();
		}
		else
		{
			validMode = false;
		}

		if (validMode)
		{
			listViewFilterMode = mode;

			setStartAndEndListViewDates(
				startYear,
				startMonth,
				startDay,
				endYear,
				endMonth,
				endDay);
		}
	}

	/**
	 * Set the start/end year, month, and day.  The time portion of the
	 * starting and ending days is automatically supplied to ensure that
	 * we will get full days of


�突検知の結果を返却
  return { hit, pos };
}import type AddinRecurrence from './schema/AddinRecurrence';

// This function renames object keys. Example- It converts
// "seriesTimeJson":{"startYear":2021,"startMonth":3,"startDay":20,"endYear":2021,"endMonth":6,"endDay":20,"startTimeMin":870,"durationMin":25}
// "seriesTime":{"startYear":2021,"startMonth":3,"startDay":20,"endYear":2021,"endMonth":6,"endDay":20,"startTimeMinutes":870,"durationMinutes":25}
export default function seriesTimeJsonConverter(recurrence: AddinRecurrence) {
    let recurrenceObj = null;
    if (recurrence) {
        recurrenceObj = JSON.parse(JSON.stringify(recurrence));
    }
    let seriesTime = recurrenceObj?.seriesTimeJson;
    if (seriesTime) {
        seriesTime.startTimeMinutes = seriesTime.startTimeMin;
        seriesTime.durationMinutes = seriesTime.durationMin;

        delete seriesTime.startTimeMin;
        delete seriesTime.durationMin;
        delete recurrenceObj.seriesTimeJson;

        recurrenceObj.seriesTime = seriesTime;
    }
    return recurrenceObj;
}
import type { Diff } from 'satisfier'
import { tersify } from 'tersify'

export function notSatisfiedMessage(entries: Diff[]) {
	return entries
		.map(e => {
			const path = formatPath(e.path)
			return `Expect ${path} to satisfy ${formatValue(e.expected)}, but received ${formatValue(e.actual)}`
		})
		.join('\n')
}

function formatPath(entries: (string | number)[]) {
	if (entries.length === 0) return 'actual'
	const nodes = [...entries]
	if (isIndice(nodes[0])) {
		nodes.unshift('actual')
	}
	return nodes
		.map(n => (isIndice(n) ? `[${n}]` : '.' + n))
		.join('')
		.slice(1)
}

function isIndice(node: string | number): node is number {
	return typeof node === 'number'
}

function formatValue(value: any) {
	return tersify(value)
}
declare const DEHYDRATED: unique symbol;
declare const HANDLE: unique symbol;

export type Hydrated<T extends Dehydrated<any>> = T extends Dehydrated<infer U> ? U : never;
export type Dehydrated<T> = { [DEHYDRATED]: T };

const HANDLE_KEY = '--stagehand-function-handle';

export type Handle = typeof HANDLE;
export interface DehydratedHandle {
  [HANDLE_KEY]: Handle;
}

export default class FunctionHandleRegistry {
  private nextFunctionHandle = 0;
  private handlesByFunction = new Map<Function, Handle>();
  private functionsByHandle = new Map<Handle, Function>();

  constructor(private hydrateRemoteFunction: (handle: Handle) => (...params: unknown[]) => unknown) {}

  public dehydrate<T>(root: T): Dehydrated<T> {
    return walk(root, (obj) => {
      if (typeof obj === 'function') {
        return dehydrateHandle(this.lookupOrGenerateHandle(obj));
      }
    });
  }

  public rehydrate<T extends Dehydrated<any>>(root: T): Hydrated<T> {
    return walk(root, (obj) => {
      if (isDehydratedHandle(obj)) {
        return this.hydrateRemoteFunction(obj[HANDLE_KEY]);
      }
    });
  }

  public lookupFunction(handle: Handle): Function | undefined {
    return this.functionsByHandle.get(handle);
  }

  public lookupHandle(f: Function): Handle | undefined {
    return this.handlesByFunction.get(f);
  }

  public releaseFunction(f: Function) {
    let handle = this.handlesByFunction.get(f);
    if (handle !== undefined) {
      this.functionsB


position = "right-center",
						icon = "hand",
					})
				end

				if IsControlJustReleased(0, SDC.Keybinds.PickupPed.Input) then
					TriggerServerEvent("SDMC:Server:PickedUpTransport", allCalls[closestTransportCall].CallType, allCalls[closestTransportCall].CallNum)
					lib.hideTextUI()
					drawingUI = nil
					FreezeEntityPosition(ped, true)
					DoProgressbar(SDC.PickupAnimTime*1000, SDC.Lang.GrabbingPatient)
					FreezeEntityPosition(ped, false)
					LoadPropDict(allCalls[closestTransportCall].PedModel)
					local daped = CreatePed(5, GetHashKey(allCalls[closestTransportCall].PedModel), coords.x, coords.y, coords -10, 0.0, true, false)
					SetBlockingOfNonTemporaryEvents(daped, true)
					SetPedDropsWeaponsWhenDead(daped, false)
					SetModelAsNoLongerNeeded(allCalls[closestTransportCall].PedModel)
					AttachEntityToEntity(daped, hasStretcher, 0, SDC.StretcherSettings.OnStrecher.Offset[1].x, SDC.StretcherSettings.OnStrecher.Offset[1].y, SDC.StretcherSettings.OnStrecher.Offset[1].z, SDC.StretcherSettings.OnStrecher.Rotation.x, SDC.StretcherSettings.OnStrecher.Rotation.y, SDC.StretcherSettings.OnStrecher.Rotation.z, true, false, false, true, 1, true)
					LoadAnim("anim@gangops@morgue@table@")
					TaskPlayAnim(daped, "anim@gangops@morgue@table@", "body_search", 8.0, -8.0, -1, 1, 0, false, false, false)
					RemoveAnimDict("anim@gangops@morgue@table@")
					isonstretcher = daped

					TriggerEvent("SDMC:Client:Notification", SDC.Lang.StoreStretcher2, "primary")
				end
				Citizen.Wait(1)
			else
				if drawingUI and drawingUI == "trans_pickup" then
					lib.hideTextUI()
					drawingUI = nil
				end
				Citizen.Wait(500)
			end
		else
			if drawingUI and drawingUI == "trans_pickup" then
				lib.hideTextUI()
				drawingUI = nil
			end
			Citizen.Wait(1000)
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		local ped = PlayerPedId()
		local coords = GetEntityCoords(ped)
		local drawing = false

		if SDC.Icons.Checkup.Enabled and closestAssitCall and not allCalls[closestAssitCall].CheckupDone and Vdist(coords.x, coords.y, coords.z, SDC.CallCoords[allCalls[closestAssitCall].CallNum]) <= SDC.Icons.Checkup.DistToDraw then
			drawing = true
			local drawC = SDC.CallCoords[allCalls[closestAssitCall].CallNum]
			SetDrawOrigin(drawC.x, drawC.y, drawC.z -0.5, 0)
			DrawSprite("medcall_sprites", "clipboard", 0.0, 0.0, 0.025, 0.04, 0, 230, 230, 230, 255)
			ClearDrawOrigin()
		end

		if SDC.Icons.PutOnStrecher.Enabled and closestAssitCall and allCalls[closestAssitCall].CheckupDone and hasStretcher and not allCalls[closestAssitCall].Grabbed and Vdist(coords.x, coords.y, coords.z, SDC.CallCoords[al


width &= ~HOST_MASK;
	    pix_width |= HOST_24BPP;
	    break;
	case 32:
	    pix_width &= ~HOST_MASK;
	    pix_width |= HOST_32BPP;
	    break;
	}

	if (info->var.bits_per_pixel == 24) {
		/* In 24 bpp, the engine is in 8 bpp - this requires that all */
		/* horizontal coordinates and widths must be adjusted */
		dx *= 3;
		width *= 3;

		rotation = rotation24bpp(dx, DST_X_LEFT_TO_RIGHT);

		pix_width &= ~DST_MASK;
		pix_width |= DST_8BPP;

		/*
		 * since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit
		 * this hwaccelerated triple has an issue with not aligned data
		 */
		if (image->depth == 1 && M64_HAS(HW_TRIPLE) && image->width % 8 == 0)
			pix_width |= DP_HOST_TRIPLE_EN;
	}

	if (image->depth == 1) {
		u32 fg, bg;
		if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
		    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
			fg = ((u32*)(info->pseudo_palette))[image->fg_color];
			bg = ((u32*)(info->pseudo_palette))[image->bg_color];
		} else {
			fg = image->fg_color;
			bg = image->bg_color;
		}

		wait_for_fifo(2, par);
		aty_st_le32(DP_BKGD_CLR, bg, par);
		aty_st_le32(DP_FRGD_CLR, fg, par);
		src = MONO_SRC_HOST | FRGD_SRC_FRGD_CLR | BKGD_SRC_BKGD_CLR;
		mix = FRGD_MIX_S | BKGD_MIX_S;
	} else {
		src = MONO_SRC_ONE | FRGD_SRC_HOST;
		mix = FRGD_MIX_D_XOR_S | BKGD_MIX_D;
	}

	wait_for_fifo(5, par);
	aty_st_le32(DP_PIX_WIDTH, pix_width, par);
	aty_st_le32(DP_MIX, mix, par);
	aty_st_le32(DP_SRC, src, par);
	aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par);
	aty_st_le32(DST_CNTL, DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT | rotation, par);

	draw_rect(dx, dy, width, image->height, par);
	src_bytes = (((image->width * image->depth) + 7) / 8) * image->height;

	/* manual triple each pixel */
	if (image->depth == 1 && info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) {
		int inbit, outbit, mult24, byte_id_in_dword, width;
		u8 *pbitmapin = (u8*)image->data, *pbitmapout;
		u32 hostdword;

		for (width = image->width, inbit = 7, mult24 = 0; src_bytes; ) {
			for (hostdword = 0, pbitmapout = (u8*)&hostdword, byte_id_in_dword = 0;
				byte_id_in_dword < 4 && src_bytes;
				byte_id_in_dword++, pbitmapout++) {
				for (outbit = 7; outbit >= 0; outbit--) {
					*pbitmapout |= (((*pbitmapin >> inbit) & 1) << outbit);
					mult24++;
					/* next bit */
					if (mult24 == 3) {
						mult24 = 0;
						inbit--;
						width--;
					}

					/* next byte */
					if (inbit < 0 || width == 0) {
						src_bytes--;
						pbitmapin++;
						inbit = 7;

						if (width == 0) {
						    width = image->width;
						    outbit = 0;
						}
					}
				}
			}
			wait_for_fifo(1, par);
			aty_st_le32(HOST_DATA0, le32_to_cpu(hostdword), par);
		}
	} else {
		u32 *pbitmap, dwords = (src_bytes + 3) / 4;
		for (pbitmap = (u32*)(image->data); dwords; dwords--, pbitmap++) {
			wait_for_fifo(1, par);
			aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par);
		}
	}
}


# ed25519.py - Optimized version of the reference implementation of Ed25519
#
# Written in 2011? by Daniel J. Bernstein <djb@cr.yp.to>
#            2013 by Donald Stufft <donald@stufft.io>
#            2013 by Alex Gaynor <alex.gaynor@gmail.com>
#            2013 by Greg Price <price@mit.edu>
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
import binascii
import codecs
import os

import pytest

import ed25519

def ed25519_known_answers():
    # Known answers taken from: http://ed25519.cr.yp.to/python/sign.input
    # File Format is a lined based file where each line has sk, pk, m, sm
    #   - Each field hex
    #   - Each field colon-terminated
    #   - sk includes pk at end
    #   - sm includes m at end
    path = os.path.join(os.path.dirname(__file__), "test_data", "ed25519")
    with codecs.open(path, "r", encoding="utf-8") as fp:
        for line in fp:
            x = line.split(":")
            yield (
                # Secret Key
                # Secret key is 32 bytes long, or 64 hex characters and has
                #   public key appended to it
                x[0][0:64].encode("ascii"),
                # Public Key
                x[1].encode("ascii"),
                # Message
                x[2].encode("ascii"),
                # Signed Message
                x[3].encode("ascii"),
                # Signature Only
                # Signature comes from the Signed Message, it is 32 bytes long
                #   and has the message appended to it
                binascii.hexlify(
                    binascii.unhexlify(x[3].encode("ascii"))[:64]
                ),
            )

@pytest.mark.parametrize(
    ("secret_key", "public_key", "message", "signed", "signature"),
    ed25519_known_answers(),
)
def test_ed25519_kat(secret_key, public_key, message, signed, signature):
    sk = binascii.unhexlify(secret_key)
    m = binascii.unhexlify(message)

    pk = ed25519.publickey_unsafe(sk)
    sig = ed25519.signature_unsafe(m, sk, pk)

    # Assert that the signature and public key are what we expected
    assert binascii.hexlify(pk) == public_key
    assert binascii.hexlify(sig) == signature

    # Validate the signature using the checkvalid routine
    ed25519.checkvalid(sig, m, pk)

    # Assert that we cannot forge a message
    try:
        if len(m) == 0:
            forgedm = b"x"
        else:
            forgedm = bytes([m[i] + (i == len(m) - 1) for i in range(len(m))])
    except ValueError:
        # TODO: Yes this means that we "pass" a test if we can't generate a
        # forged message. This matches the original test suite, it's
        # unclear if it was intentional there or not.
        pass
    else:
        with pytest.raises(ed25519.SignatureMismatch):
            ed25519.checkvalid(sig, forgedm, pk)

def test_checkparams():
    # Taken from checkparams.py from DJB
    assert ed25519.b >= 10
    assert 8 * len(ed25519.H(b"hash input")) == 2 * ed25519.b
    assert pow(2, ed25519.q - 1, ed25519.q) == 1
    assert ed25519.q % 4 == 1
    assert pow(2, ed25519.l - 1, ed25519.l) == 1
    assert ed25519.l >= 2 ** (ed25519.b - 4)
    assert ed25519.l <= 2 ** (ed25519.b - 3)
    assert pow(ed25519.d, (ed25519.q - 1) // 2, ed25519.q) == ed25519.q - 1
    assert pow(ed25519.I, 2, ed25519.q) == ed25519.q - 1
    assert ed25519.isoncurve(ed25519.B)
    x, y, z, t = P = ed25519.scalarmult(ed25519.B, ed25519.l)
    assert ed25519.isoncurve(P)
    assert (x, y) == (0, z)


end	= MPC52xx_PSC6_IRQ,
				.flags	= IORESOURCE_IRQ,
			},
		},
	},
	[MPC52xx_FEC] = {
		.name		= "mpc52xx-fec",
		.id		= -1,
		.num_resources	= 2,
		.resource	= (struct resource[]) {
			{
				.start	= 0x3000,
				.end	= 0x33ff,
				.flags	= IORESOURCE_MEM,
			},
			{
				.start	= MPC52xx_FEC_IRQ,
				.end	= MPC52xx_FEC_IRQ,
				.flags	= IORESOURCE_IRQ,
			},
		},
	},
	[MPC52xx_ATA] = {
		.name		= "mpc52xx-ata",
		.id		= -1,
		.num_resources	= 2,
		.resource	= (struct resource[]) {
			{
				.start	= 0x3a00,
				.end	= 0x3aff,
				.flags	= IORESOURCE_MEM,
			},
			{
				.start	= MPC52xx_ATA_IRQ,
				.end	= MPC52xx_ATA_IRQ,
				.flags	= IORESOURCE_IRQ,
			},
		},
	},
	[MPC52xx_I2C1] = {
		.name		= "fsl-i2c",
		.id		= 0,
		.dev.platform_data = &mpc52xx_fsl_i2c_pdata,
		.num_resources	= 2,
		.resource	= (struct resource[]) {
			{
				.start	= 0x3d00,
				.end	= 0x3d1f,
				.flags	= IORESOURCE_MEM,
			},
			{
				.start	= MPC52xx_I2C1_IRQ,
				.end	= MPC52xx_I2C1_IRQ,
				.flags	= IORESOURCE_IRQ,
			},
		},
	},
	[MPC52xx_I2C2] = {
		.name		= "fsl-i2c",
		.id		= 1,
		.dev.platform_data = &mpc52xx_fsl_i2c_pdata,
		.num_resources	= 2,
		.resource	= (struct resource[]) {
			{
				.start	= 0x3d40,
				.end	= 0x3d5f,
				.flags	= IORESOURCE_MEM,
			},
			{
				.start	= MPC52xx_I2C2_IRQ,
				.end	= MPC52xx_I2C2_IRQ,
				.flags	= IORESOURCE_IRQ,
			},
		},
	},
};

static int __init mach_mpc52xx_fixup(struct platform_device *pdev)
{
	ppc_sys_fixup_mem_resource(pdev, MPC52xx_MBAR);
	return 0;
}

static int __init mach_mpc52xx_init(void)
{
	ppc_sys_device_fixup = mach_mpc52xx_fixup;
	return 0;
}

postcore_initcall(mach_mpc52xx_init);


", &collector, &err_str));
      std::string expected_err =
        StrCat("error: dummy Line ", std::get<2>(test),
               ", ConsumeLine failed without setting an error.");
      EXPECT_EQ(err_str, expected_err);
    }
  }
}

// TODO(thomasvl): Should probably add some unittests for all the special cases
// of name mangling (class name, field name, enum names).  Rather than doing
// this with an ObjC test in the objectivec directory, we should be able to
// use src/google/protobuf/compiler/importer* (like other tests) to support a
// virtual file system to feed in protos, once we have the Descriptor tree, the
// tests could use the helper methods for generating names and validate the
// right things are happening.

}  // namespace
}  // namespace objectivec
}  // namespace compiler
}  // namespace protobuf
}  // namespace google
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.  All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <sstream>

#include <google/protobuf/compiler/code_generator.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/wire_format.h>

#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h>

namespace google {
namespace protobuf {
namespace compiler {
namespace csharp {

RepeatedPrimitiveFieldGenerator::RepeatedPrimitiveFieldGenerator(
    const FieldDescriptor* descriptor, int presenceIndex, const Options *options)
    : FieldGeneratorBase(descriptor, presenceIndex, options) {
}

RepeatedPrimitiveFieldGenerator::~RepeatedPrimitiveFieldGenerator() {

}

void RepeatedPrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) {
  printer->Print(
    variables_,
    "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\n"
    "    = pb::FieldCode


  sorted(testcases_threads.values(), key=lambda tc:tc.__name__) +
        sorted(testcases_manager.values(), key=lambda tc:tc.__name__) +
        testcases_other
        )

    loadTestsFromTestCase = unittest.defaultTestLoader.loadTestsFromTestCase
    suite = unittest.TestSuite(loadTestsFromTestCase(tc) for tc in testcases)
    run(suite)

    ThreadsMixin.pool.terminate()
    ProcessesMixin.pool.terminate()
    ManagerMixin.pool.terminate()
    ManagerMixin.manager.shutdown()

    del ProcessesMixin.pool, ThreadsMixin.pool, ManagerMixin.pool

def main():
    test_main(unittest.TextTestRunner(verbosity=2).run)

if __name__ == '__main__':
    main()


hashName);
        updateMapCombo(false);
        loadMap(false);
    }
}

function exportMap() {
    var blob = new Blob([JSON.stringify(theMap)], { type: "text/plain;charset=utf-8" });
    saveAs(blob, theMap.shortName() + ".json");
}

window.onload = () => {
    theCanvas = <HTMLCanvasElement>document.getElementById('mapCanvas');

    updateMapCombo(false);
    loadMap(false);

    theCanvas.addEventListener('click', onClick, false);
    theCanvas.addEventListener('mousemove', onMouseMove, false);
    theCanvas.addEventListener('wheel', onMouseWheel, false);

    var fileInput = <HTMLInputElement>document.getElementById('fileInput');
    fileInput.addEventListener('change', function (e) {
        let file = fileInput.files[0];
        let textType = /text.*/;
        var reader = new FileReader();
        reader.onload = function (e) {
            let map = JSON.parse(reader.result);
            importMap(map);
        }
        reader.readAsText(file);
        fileInput.value = null;
    });

    renderMap();
};import {CellCoords} from '../../types';
import {EventDef} from '../types/EventDef';

export interface UpdateCursorEvent {
  id: string;
  cell: CellCoords;
  timestamp?: number;
}

const updateCursor: EventDef<UpdateCursorEvent> = {
  reducer(state, {id, cell, timestamp}) {
    if (!state.users[id]) {
      return state; // illegal update if no user exists with id
    }
    return {
      ...state,
      users: {
        ...state.users,
        [id]: {
          ...state.users[id]!,
          cursor: {
            ...cell,
            id,
            timestamp: timestamp!,
          },
        },
      },
    };
  },
};

export default updateCursor;
import { NodeInstance } from "../../src/Model";

describe('constructFromJson', () => {
    it('should construct a single NodeInstance from Json', async () => {
        let jsonStr = '{ "Name": "test", "Width": 1, "Height": 2, "TopLeftCoordinate": {"X":3,"Y":4} }';
        let json = JSON.parse(jsonStr);
        let instance: NodeInstance = json;

        expect(instance.Name).toBe("test");
        expect(instance.Width).toBe(1);
        expect(instance.Height).toBe(2);
        expect(instance.TopLeftCoordinate.X).toBe(3);
        expect(instance.TopLeftCoordinate.Y).toBe(4);
    });

    it('should construct a multiple NodeInstances from Json', async () => {
        let jsonStr = '[{ "Name": "test1", "Width": 1, "Height": 2, "TopLeftCoordinate": {"X":3,"Y":4} }, { "Name": "test2", "Width": 5, "Height": 6, "TopLeftCoordinate": {"X":7,"Y":8} }]';
        let json = JSON.parse(jsonStr);
        let instance: NodeInstance[] = NodeInstance.CreateFromJson(json);

        expect(instance.length).toBe(2);

        expect(instance[0].Name).toBe("test1");
        expect(instance[0].Width).toBe(1);
        expect(instance[0].Height).toBe(2);
        expect(instance[0].TopLeftCoordinate.X).toBe(3);
        expect(instance[0].TopLeftCoordinate.Y).toBe(4);

        expect(instance[1].Name).toBe("test2");
        expect(instance[1].Width).toBe(5);
        expect(instance[1].Height).toBe(6);
        expect(instance[1].TopLeftCoordinate.X).toBe(7);
        expect(instance[1].TopLeftCoordinate.Y).toBe(8);

        instance[1].AddTeleportZonePoint();
    });
}); /**
 * Soho Searchfield Control Typings.
 *
 * This file contains the Typescript mappings for the public
 * interface of the Soho jQuery searchfield control.
 */

/**
 * Configuration options.
 */
in


			suffix: "",
				},
				{
					tag:    "kessoku",
					id:     "2",
					prefix: "nijika\x00ryo\x00bocchi\x00\x00",
					suffix: "kita",
				},
				{
					tag:    "kessoku",
					id:     "2",
					prefix: "ryo\x00bocchi\x00\x00",
					suffix: "nijika",
				},
				{
					tag:    "kessoku",
					id:     "2",
					prefix: "bocchi\x00\x00",
					suffix: "ryo",
				},
				{
					tag:    "kessoku",
					id:     "2",
					prefix: "\x00",
					suffix: "bocchi",
				},
				{
					tag:    "kessoku",
					id:     "5",
					prefix: "bocchi\x00\x00",
					suffix: "",
				},
				{
					tag:    "kessoku",
					id:     "5",
					prefix: "\x00",
					suffix: "bocchi",
				},
				{
					tag:     "sickhack",
					id:      "2",
					prefix:  "kikuri\x00\x00",
					suffix:  "",
					deleted: ref("CLEARMSG"),
				},
				{
					tag:     "sickhack",
					id:      "2",
					prefix:  "\x00",
					suffix:  "kikuri",
					deleted: ref("CLEARMSG"),
				},
			},
			msgs: []msg{
				{
					tag:  "kessoku",
					id:   "2",
					time: 3e6,
					user: userhash.Hash{1},
				},
				{
					tag:  "kessoku",
					id:   "5",
					time: 6e6,
					user: userhash.Hash{4},
				},
				{
					tag:     "sickhack",
					id:      "2",
					time:    3e6,
					user:    userhash.Hash{1},
					deleted: ref("CLEARMSG"),
				},
			},
		},
	}
	for _, c := range cases {
		t.Run(c.name, func(t *testing.T) {
			t.Parallel()
			ctx := context.Background()
			db := testDB(ctx)
			br, err := sqlbrain.Open(ctx, db)
			if err != nil {
				t.Fatalf("couldn't open brain: %v", err)
			}
			for _, m := range learn {
				msg := brain.Message{
					ID:        m.id,
					Sender:    m.user,
					Timestamp: m.t,
				}
				err := br.Learn(ctx, m.tag, &msg, m.tups)
				if err != nil {
					t.Errorf("failed to learn %v/%v: %v", m.tag, m.id, err)
				}
			}
			conn, err := db.Take(ctx)
			defer db.Put(conn)
			if err != nil {
				t.Fatalf("couldn't get conn to check db state: %v", err)
			}
			contents(t, conn, initKnow, initMsgs)
			if t.Failed() {
				t.Fatal("setup failed")
			}
			if err := br.Forget(ctx, c.tag, c.id); err != nil {
				t.Errorf("failed to delete %v/%v: %v", c.tag, c.id, err)
			}
			contents(t, conn, c.know, c.msgs)
		})
	}
}
package eventsub

import "github.com/go-json-experiment/json/jsontext"

// Event is a payload of a notification message.


/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation;

// Author: Baltzis Petros<mpaltzis@ceid.upatras.gr>

#ifndef LEAKY_BUCKET_HELPER_H
#define LEAKY_BUCKET_HELPER_H

#include "ns3/object-factory.h"
#include "ns3/address.h"
#include "ns3/attribute.h"
#include "ns3/node.h"

namespace ns3 {

/**
 * \brief A helper to make it easier to instantiate an ns3::LeakyBucket
 * on a set of nodes.
 */

class LeakyBucketHelper
{
public:

  LeakyBucketHelper ();

  /**
   * Helper function used to set the underlying attributes of leaky-bucket.
   *
   * \param name the name of the leaky-bucket attribute to set
   * \param value the value of the leaky-bucket attribute to set
   */
  void SetAttribute (std::string name, const AttributeValue &value);

  void Install (Ptr<NetDevice> ShapedDevice) const;

private:
  ObjectFactory m_factory;

};

} // namespace ns3

#endif /* ON_OFF_HELPER_H */


*/
export type TreemapNode = TreemapNodeLeaf | TreemapNodeParent;
export type D3TreemapNode = d3.HierarchyNode<TreemapNode>;

/**
 * Converts a list of controls to treemap leaves.
 * Actually a one-to-many mapping since we must make a unique leaf for each nist control on each control!
 * @param controls The controls to build into a nist node map
 */
function controls_to_nist_node_data(
  contextualized_controls: Readonly<context.ContextualizedControl[]>,
  colors: ColorHackModule
): TreemapNodeLeaf[] {
  return contextualized_controls.flatMap(cc => {
    // Get the status color
    let color = Chroma.hex(colors.colorForStatus(cc.root.hdf.status));
    // Now make leaves for each nist control
    return cc.root.hdf.parsed_nist_tags.map(nc => {
      let leaf: TreemapNodeLeaf = {
        title: cc.data.id,
        subtitle: cc.data.title || undefined,
        hovertext: cc.data.desc || undefined,
        key: control_unique_key(cc) + nc.raw_text,
        control: cc,
        nist_control: nc,
        color,
        parent: null // We set this later
      };
      return leaf;
    });
  });
}

/** Builds a scaffolding for the nist items using the given root.
 * Also constructs a lookup table of control nodes.
 * Only goes max_depth deep.
 */
function recursive_nist_map(
  parent: TreemapNodeParent | null,
  node: Readonly<nist.NistHierarchyNode>,
  control_lookup: { [key: string]: TreemapNodeParent },
  max_depth: number
): TreemapNodeParent {
  // Init child list
  let children: TreemapNode[] = [];

  // Make our final value
  let ret: TreemapNodeParent = {
    key: node.control.raw_text!,
    title: node.control.raw_text!, // TODO: Make this like, suck less. IE give more descriptive stuff
    nist_control: node.control,
    parent,
    children
  };

  // Fill our children
  if (node.control.sub_specifiers.length < max_depth) {
    node.children.forEach(child => {
      // Get the last subspec.
      let final_subspec =
        child.control.sub_specifiers[child.control.sub_specifiers.length - 1];

      // Assign it, recursively computing the rest
      children.push(recursive_nist_map(ret, child, control_lookup, max_depth));
    });
  }

  // Save to lookup
  control_lookup[lookup_key_for(node.control, max_depth)] = ret;
  return ret;
}

/** Colorizes a treemap based on each nodes children. */
function colorize_tree_map(root: TreemapNodeParent) {
  // First colorize children, recursively
  root.children.forEach(child => {
    if (is_parent(child)) {
      colorize_tree_map(child);
    }
  });

  // Now all children should have valid colors
  // We decide this node's color as a composite of all underlying node colors
  let child_colors = root.children
    .map(c => c.color)
    .filter(c => c !== undefined) as Chroma.Color[];
  // If we have any, then set our color
  if (child_colors.length) {
    // Set the color
    let avg_color = Chroma.average(child_colors);
    root.color = avg_color;
  }
}

/** Generates a lookup key for the given control */
function lookup_key_for(x: nist.NistControl, max_depth: number): string {
  if (max_depth) {
    return x.sub_specifiers.slice(0, max_depth).join("-");
  } else {
    return x.sub_specifiers.join("-");
  }


34jK1Jk6VT/"        \
  "x83HsZZHFaDLQov1dP9gNAMvmItMzF99N26+QM0xzGyd1NG3vx7cvGMQe2Flvf/"            \
  "nbSajF9W32brvVMk+7b9uwetObQFh8AUjYUlVb4B2Kq5oLCGBuKhIP8byZy6k0Fy/"          \
  "P7VLTPiCKAqKtn1I4yy4MRVYUi94hYM9q163TiXMVijoCQBlgBIAEAAGyfygLXGCzgsKJUvzv9" \
  "XsNFCjlU+yZdS4D2WD4dm8oyL0+5TdC9AAAAAOSQ49//"                               \
  "kCTDIgMwAI6dPc3tnLUcLWWKMTh3gAtGuRBrX8HcVR2OmbiORPgtuEJZSZiw4OIuJlOhrDgCWN" \
  "qTvazq8R1kGqXJdTJxtXJKFMGgpws9wcyEk9FRCbfVYK7HpfDKt6iRl2yPW3hTVjWw8HljZcsx" \
  "BrKd+rDCSQCAGKtxnRWOVybT4lpXTXidEUdPVgF4UL9swRV23u0ZD+"                     \
  "F0MRKXIawEFIB1ekIgDYGbwsMKU+"                                               \
  "0ozKo9Z2TkC0c3gMxmkYQbJsxQOzYjDyQkIuv7bsFeisuWiRwzYCSRqHXOjQg98QZbtYEYxjGc" \
  "QcARkID2pQDgwPm9ngRunDrVrqxYyYraKzL4/"                                      \
  "nJO3t3aACCBuWOB5ax1sNREyTiHA2wFfRZkaS4gkWMr6LMg2DOhYKapgsoCSDNCBtw9OxjKFWD" \
  "CykgduoxFYqpga3WXZEJdsKgHsYBJTARBmHkdFKsAQCmnXnwROSE7Hv6llTQVfDiNLyIjZBf2/" \
  "ksraS74cBrfqkTCRD5PUtVGNNMKXBQCXNlcVlBc3JeFFaQQFSmXY1K0woOGWAXocnERodAlpA6" \
  "qrJyaaTkB4Jizva1jptWWCYvjdk79BZjTT5tmqsXOxhCQCDJiPlKf74sLJSRcEWkl5I7tv9mpY" \
  "BrTuCLSSsgd27/"                                                             \
  "ZqWCapv0HIOTKyCpCDKk6j0huPhQVAAtocQIRWkiGIAYtJsnw9BAjYl4xuuSLUnHcx2tjuUQyZ" \
  "hTkDACHjsQhFltHamcRO8SwkekNAZhRrXYOp5uxrLd4XtEwbb8z73zWNpwRWZbbM239xM8kh+"  \
  "uMyLLcnj0cip8LZsytqkYyyYqoriqQu5FSj1dkFaJAQSnL43E4lBKlTCgqQknRouwQXhEVEbg7" \
  "NHGEdOWrR9X0wRWbhOXu4rUZu3p+"                                               \
  "8FtsDIsThmlnNTCMKQ4thuOOKKuNZUbFxBOPz3vyLzwRKSzpbvMJu4IBp56ICCKJx9zGrmDDqb" \
  "OGUiFCT7KTkUeojo


게 감사의 편지를 보낸 것일지도 몰르겠데이.",
		lose = "",
		propose = "",
		hp_warning = "",
		id = 301641,
		voice_key = 0,
		feeling5 = "지휘관, 선물 배달 끝나면 시간 있나? 히힛, 내가 사랑하는 지휘관을 위해 특별한 선물을 준비했다아이가. 너무 놀라지마래이~",
		main = "지휘관, 니는 어떤 선물이 가지고 싶노? 어쩌면 내가 준비해줄 수도 있다아이가?|크리스마스라면 역시 모두 모여서 파티를 여는게 더 신나지 않겠나~|역시 연말이 오니까 모두들 얼굴에 웃음이 가득하데이, 히히, 나도 신난데이",
		voice_key_2 = -1,
		profile = "",
		mission_complete = "임무 보상을 사령부가 우리에게 준 크리스마스 선물이라고 생각한다면 기쁘지 않겠나~",
		headtouch = "",
		feeling2 = "",
		feeling4 = "",
		unlock = "Merry Christmas~ 지휘관, 우리 같이 구축함 아들에게 선물 주러 가제이. 지휘관, 니는 산타고 내는 순록이다, 히히~",
		battle = "",
		login = "",
		vote = "",
		detail = "이 옷은 역시 조금 갑갑하데이......내년에는 새로운 옷으로 갈아입을끼다."
	},
	[301642] = {
		touch = "지휘관, 왜 그렇게 쳐다보노……?",
		feeling3 = "",
		upgrade = "",
		expedition = "",
		win_mvp = "",
		home = "돈다 돌아~ 내 취한거 같다. 지휘관 내 우짜면 좋노.",
		mission = "",
		touch2 = "쫌만 마셔도 바로 취하네… 상대가 내니까 다행이지~",
		feeling1 = "",
		skill = "",
		drop_descrip = "간만인데 지대로 안놀아볼래? 내도 멀리서 귀여운 여자애들 보면서 놀거니께. 지휘관 니도 즐기라~",
		mail = "",
		lose =


  DEFAULT_HEIGHT,
  DEFAULT_MARGIN,
  DEFAULT_INNER_WIDTH,
  DEFAULT_INNER_HEIGHT,
  MAX_SCALE,
} from '../../viewport';

export const DEFAULT_ITEM_WIDTH = DEFAULT_WIDTH * 2;
export const DEFAULT_ITEM_HEIGHT = DEFAULT_HEIGHT * 2;
export const DEFAULT_MAX_ITEM_VIEW_WIDTH = DEFAULT_INNER_WIDTH * MAX_SCALE;
export const DEFAULT_MAX_ITEM_VIEW_HEIGHT = DEFAULT_INNER_HEIGHT * MAX_SCALE;
export const ZOOMED_OUT = 0;
export const ZOOMED_HALF = 50;
export const ZOOMED_IN = 100;
export const ZOOMED_EXCESSIVE = 200;
export const DRAG_DELTA_X = -10;
export const DRAG_DELTA_Y = -20;
export const DRAG_DELTA_X_HUGE = 10000000;
export const DRAG_DELTA_Y_HUGE = 20000000;

export const setup = (
  scale: number = 0, // 0 - 100
  dragX: number = 0,
  dragY: number = 0,
  itemWidth: number = DEFAULT_ITEM_WIDTH,
  itemHeight: number = DEFAULT_ITEM_HEIGHT,
) => {
  const viewport = new Viewport();
  viewport
    .setItemSize(itemWidth, itemHeight)
    .setScale(scale)
    .dragBy(dragX, dragY);
  return viewport;
};

describe('Viewport', () => {
  describe('Layout', () => {
    let viewport: Viewport;

    beforeAll(() => (viewport = setup()));

    it('should calculate correct inner bounds', () => {
      const { innerBounds } = viewport;
      expect(innerBounds.left).toEqual(DEFAULT_MARGIN);
      expect(innerBounds.top).toEqual(DEFAULT_MARGIN);
      expect(innerBounds.width).toEqual(DEFAULT_INNER_WIDTH);
      expect(innerBounds.height).toEqual(DEFAULT_INNER_HEIGHT);
    });

    it('should calculate correct outer bounds', () => {
      const { outerBounds } = viewport;
      expect(outerBounds.left).toEqual(0);
      expect(outerBounds.top).toEqual(0);
      expect(outerBounds.width).toEqual(DEFAULT_WIDTH);
      expect(outerBounds.height).toEqual(DEFAULT_HEIGHT);
    });

    it('should calculate correct fitted item bounds', () => {
      const viewport = setup();
      const { fittedItemBounds: rect } = viewport;
      expect(rect.width).toEqual(DEFAULT_INNER_WIDTH);
      expect(rect.height).toEqual(DEFAULT_INNER_HEIGHT);
    });

    it('should know when no item size set', () => {
      const viewport = new Viewport(0, 0, 0);
      expect(viewport.isEmpty).toBeTruthy();
    });

    describe('visible source bounds', () => {
      it('should give whole image when first positioned', () => {
        const viewport = setup();
        const { visibleSourceBounds } = viewport;
        expect(visibleSourceBounds.left).toEqual(0);
        expect(visibleSourceBounds.top).toEqual(0);
        expect(visibleSourceBounds.width).toEqual(DEFAULT_ITEM_WIDTH);
        expect(visibleSourceBounds.height).toEqual(DEFAULT_ITEM_HEIGHT);
      });

      it('should give correct portion of total image width when half zoomed in', () => {
        const viewport = setup(ZOOMED_HALF);
        const visibleSourceBounds = viewport.visibleSourceBounds.map(
          Math.round,
        );
        expect(visibleSourceBounds.left).toEqual(58);
        expect(visibleSourceBounds.top).toEqual(58);
        expect(visibleSourceBounds.width).toEqual(84);
        expect(visibleSourceBounds.height).toEqual(84);
      });

      it('should give quarter of total image size when fully zoomed in', () => {
        const viewport = setup(
          ZOOMED_IN,
          DEFAULT_MAX_ITEM_VIEW_WIDTH /


e-btn.e-control,
.e-rte-elements .e-rte-emojipicker-popup.e-popup.e-popup-open .e-rte-emojipicker-btn .e-rte-emojisearch-btn .e-btn.e-control {
  display: inline-block;
  box-shadow: none;
  font-size: 24px;
  padding: 6px 0;
  width: 40px;
  height: 40px;
  border: none;
  line-height: 1px;
}

.e-richtexteditor .e-rte-emojipicker-popup.e-popup.e-popup-open .e-rte-emojipicker-btn .e-rte-emojipicker-group .e-rte-emojipicker-name,
.e-rte-elements .e-rte-emojipicker-popup.e-popup.e-popup-open .e-rte-emojipicker-btn .e-rte-emojipicker-group .e-rte-emojipicker-name {
  font-weight: 400;
  font-size: 14px;
}

.e-richtexteditor .e-rte-emojipicker-popup.e-popup.e-popup-open .e-rte-emojipicker-btn .e-rte-emojiSearch-noEmoji,
.e-rte-elements .e-rte-emojipicker-popup.e-popup.e-popup-open .e-rte-emojipicker-btn .e-rte-emojiSearch-noEmoji {
  text-align: center;
}

.e-rte-backgroundcolor-colorpicker .e-color-palette.e-container .e-custom-palette .e-palette,
.e-rte-fontcolor-colorpicker .e-color-palette.e-container .e-custom-palette .e-palette {
  padding: 0;
}

.e-rte-backgroundcolor-colorpicker .e-color-palette.e-container .e-switch-ctrl-btn,
.e-rte-fontcolor-colorpicker .e-color-palette.e-container .e-switch-ctrl-btn {
  padding: 5px;
}

.e-bigger .e-rte-backgroundcolor-colorpicker .e-color-palette.e-container .e-switch-ctrl-btn,
.e-bigger .e-rte-fontcolor-colorpicker .e-color-palette.e-container .e-switch-ctrl-btn {
  padding: 5px;
}

.e-rte-quick-popup {
  border-radius: 2px;
  overflow: hidden;
}

.e-rte-quick-popup .e-rte-quick-toolbar {
  border-radius: 2px;
  min-height: 42px;
}

.e-rte-quick-popup .e-rte-quick-toolbar .e-toolbar-items:not(.e-tbar-pos).e-toolbar-multirow {
  white-space: nowrap;
  display: inline-block;
}

.e-rte-quick-popup .e-rte-quick-toolbar.e-remove-white-space .e-toolbar-items:not(.e-tbar-pos).e-toolbar-multirow {
  white-space: nowrap;
}

.e-rte-quick-popup .e-rte-quick-toolbar .e-toolbar-items:not(.e-tbar-pos) {
  border-radius: 2px;
  margin: 0 6px;
  min-height: 42px;
}

.e-rte-quick-popup .e-rte-quick-toolbar .e-toolbar-items:not(.e-tbar-pos) .e-toolbar-item.e-rte-horizontal-separator,
.e-rte-quick-popup .e-rte-quick-toolbar .e-to


unsigned Src0Mods
      = TII->getNamedOperand(MI, AMDGPU::OpName::src0_modifiers)->getImm();
    unsigned Src1Mods
      = TII->getNamedOperand(MI, AMDGPU::OpName::src1_modifiers)->getImm();

    // Having a 0 op_sel_hi would require swizzling the output in the source
    // instruction, which we can't do.
    unsigned UnsetMods = (Op == AMDGPU::V_PK_MAX_F16) ? SISrcMods::OP_SEL_1
                                                      : 0u;
    if (Src0Mods != UnsetMods && Src1Mods != UnsetMods)
      return nullptr;
    return Src0;
  }
  default:
    return nullptr;
  }
}

// We obviously have multiple uses in a clamp since the register is used twice
// in the same instruction.
static bool hasOneNonDBGUseInst(const MachineRegisterInfo &MRI, unsigned Reg) {
  int Count = 0;
  for (auto I = MRI.use_instr_nodbg_begin(Reg), E = MRI.use_instr_nodbg_end();
       I != E; ++I) {
    if (++Count > 1)
      return false;
  }

  return true;
}

// FIXME: Clamp for v_mad_mixhi_f16 handled during isel.
bool SIFoldOperands::tryFoldClamp(MachineInstr &MI) {
  const MachineOperand *ClampSrc = isClamp(MI);
  if (!ClampSrc || !hasOneNonDBGUseInst(*MRI, ClampSrc->getReg()))
    return false;

  MachineInstr *Def = MRI->getVRegDef(ClampSrc->getReg());

  // The type of clamp must be compatible.
  if (TII->getClampMask(*Def) != TII->getClampMask(MI))
    return false;

  MachineOperand *DefClamp = TII->getNamedOperand(*Def, AMDGPU::OpName::clamp);
  if (!DefClamp)
    return false;

  LLVM_DEBUG(dbgs() << "Folding clamp " << *DefClamp << " into " << *Def
                    << '\n');

  // Clamp is applied after omod, so it is OK if omod is set.
  DefClamp->setImm(1);
  MRI->replaceRegWith(MI.getOperand(0).getReg(), Def->getOperand(0).getReg());
  MI.eraseFromParent();
  return true;
}

static int getOModValue(unsigned Opc, int64_t Val) {
  switch (Opc) {
  case AMDGPU::V_MUL_F32_e64: {
    switch (static_cast<uint32_t>(Val)) {
    case 0x3f000000: // 0.5
      return SIOutMods::DIV2;
    case 0x40000000: // 2.0
      return SIOutMods::MUL2;
    case 0x40800000: // 4.0
      return SIOutMods::MUL4;
    default:
      return SIOutMods::NONE;
    }
  }
  case AMDGPU::V_MUL_F16_e64: {
    switch (static_cast<uint16_t>(Val)) {
    case 0x3800: // 0.5
      return SIOutMods::DIV2;
    case 0x4000: // 2.0
      return SIOutMods::MUL2;
    case 0x4400: // 4.0
      return SIOutMods::MUL4;
    default:
      return SIOutMods::NONE;
    }
  }
  default:
    llvm_unreachable("invalid mul opcode");
  }
}

// FIXME: Does this really not support denormals with f16?
// FIXME: Does this need to check IEEE mode bit? SNaNs are generally not
// handled, so will anything other than that b


cts ON projects.id = instances.project_id").
// 		Joins("LEFT JOIN roles ON roles.id = project_member_group_roles.role_id").
// 		Where("project_member_group_roles.deleted_at IS NULL").
// 		Where("projects.deleted_at IS NULL").
// 		Where("user_groups.deleted_at IS NULL").
// 		Where("instances.deleted_at IS NULL").
// 		Where("roles.deleted_at IS NULL").
// 		Where("projects.name = ?", projectName).
// 		Where("user_groups.name in (?)", names).
// 		Scan(&roles).Error

// 	if err != nil {
// 		return nil, errors.ConnectStorageErrWrapper(err)
// 	}

// 	removeDuplicate := map[string]struct{}{}
// 	resp := map[string][]BindRole{}

// A:
// 	for _, role := range roles {
// 		// 去重
// 		fg := role.RoleName + role.InstanceName + role.GroupName
// 		if _, ok := removeDuplicate[fg]; ok {
// 			continue
// 		}
// 		removeDuplicate[fg] = struct{}{}

// 		// resp中已有此用户组+实例的信息时走这里
// 		for i, bindRole := range resp[role.GroupName] {
// 			if bindRole.InstanceName == role.InstanceName {
// 				resp[role.GroupName][i].RoleNames = append(resp[role.GroupName][i].RoleNames, role.RoleName)
// 				continue A
// 			}
// 		}
// 		// resp还没记录过此用户或此用户+实例的信息时走这里
// 		resp[role.GroupName] = append(resp[role.GroupName], BindRole{
// 			InstanceName: role.InstanceName,
// 			RoleNames:    []string{role.RoleName},
// 		})
// 	}

// 	return resp, nil
// }

// func (s *Storage) GetRoleByName(name string) (*Role, bool, error) {
// 	role := &Role{}
// 	err := s.db.Where("name = ?", name).Find(role).Error
// 	if err == gorm.ErrRecordNotFound {
// 		return role, false, nil
// 	}
// 	return role, true, errors.New(errors.ConnectStorageError, err)
// }

// func (s *Storage) GetRolesByNames(names []string) ([]*Role, error) {
// 	roles := []*Role{}
// 	err := s.db.Where("name in (?)", names).Find(&roles).Error
// 	return roles, errors.New(errors.ConnectStorageError, err)
// }

// func (s *Storage) UpdateRoleUsers(role *Role, users ...*User) error {
// 	err := s.db.Model(role).Association("Users").Replace(users).Error
// 	return errors.New(errors.ConnectStorageError, err)
// }

// func (s *Storage) UpdateRoleInstances(role *Role, instances ...*Instance) error {
// 	err := s.db.Model(role).Association("Instances").Replace(instances).Error
// 	return errors.New(errors.ConnectStorageError, err)
// }

// var roleTipsQueryTpl = `SELECT roles.name,
// GROUP_CONCAT(DISTINCT COALESCE(role_operations.op_code,'')) AS operations_codes
// {{ template "body" . }}
// GROUP BY roles.id
// `

// var roleTipsQueryBodyTpl = `
// {{ define "body" }}
// FROM roles
// LEFT JOIN role_operations ON role_operations.role_id = roles.id AND role_operations.deleted_at IS NULL
// WHERE
// roles.deleted_at IS NULL

// {{- end }}
//


) => throw '';
  C operator &(A v) => throw '';
}

class C extends B {}

T f<T>() => throw '';

class Base {
  B member;
  B? member2;

  Base(this.member);
}

class Test extends Base {
  Test(B member) : super(member);

  void test() {
    super.member = /*@typeArgs=B*/ f();

    super. /*@target=Base.member2*/ member2 ??= /*@typeArgs=B?*/ f();

    super
        . /*@target=Base.member*/ member /*@target=B.+*/ += /*@typeArgs=C*/ f();

    super
        . /*@target=Base.member*/ member /*@target=B.**/ *= /*@typeArgs=B*/ f();

    super
        . /*@target=Base.member*/ member /*@target=B.&*/ &= /*@typeArgs=A*/ f();

    /*@target=B.-*/ --super. /*@target=Base.member*/ member;

    super. /*@target=Base.member*/ member /*@target=B.-*/ --;

    var /*@type=B*/ v1 = super.member = /*@typeArgs=B*/ f();

    var /*@type=B?*/ v2 =
        super. /*@target=Base.member2*/ member2 ??= /*@typeArgs=B?*/ f();

    var /*@type=B*/ v3 = super
        . /*@target=Base.member*/ member /*@target=B.+*/ += /*@typeArgs=C*/ f();

    var /*@type=B*/ v4 = super
        . /*@target=Base.member*/ member /*@target=B.**/ *= /*@typeArgs=B*/ f();

    var /*@type=C*/ v5 = super
        . /*@target=Base.member*/ member /*@target=B.&*/ &= /*@typeArgs=A*/ f();

    var /*@type=B*/ v6 =
        /*@target=B.-*/ --super. /*@target=Base.member*/ member;

    var /*@type=B*/ v7 = super
        . /*@type=B*/ /*@target=Base.member*/
        /*@type=B*/ member /*@target=B.-*/ --;
  }
}

main() {}
// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/*@testedFeatures=inference*/
library test;

main() {
  var /*@type=() -> Null*/ a = /*@ returnType=Null */ () {};
  var /*@type=() -> Null*/ b = /*@ returnType=Null */ () {
    return;
  };
  var /*@type=() -> Null*/ c = /*@ returnType=Null */ () {
    return null;
  };
  var /*@type=() -> int*/ d = /*@returnType=int*/ () {
    return 0;
  };
  var /*@type=(bool) -> Null*/ e = /*@ returnType=Null */ (bool b) {
    if (b) {
      return;
    } else {
      return;
    }
  };
  var /*@type=(bool) -> Null*/ f = /*@ returnType=Null */ (bool b) {
    if (b) {
      return;
    } else {
      return null;
    }
  };
  var /*@type=(bool) -> int?*/ g = /*@returnType=int?*/ (bool b) {
    if (b) {
      return;
    } else {
      return 0;
    }
  };
  var /*@type=(bool) -> Null*/ h = /*@ returnType=Null */ (bool b) {
    if (b) {
      return null;
    } else {


 for iOS
    await _firebaseMessaging.requestPermission();

    // Get FCM token for sending notifications
    String? token = await _firebaseMessaging.getToken();
    print("FCM Token: $token");

    // Set up background message handler
    FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);

    // Set up foreground message handler
    FirebaseMessaging.onMessage.listen((RemoteMessage message) {
      print("New FCM message received: ${message.notification?.title} - ${message.notification?.body}");
      _showNotificationFromMessage(message);
    });
  }

  static Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
    print("Handling a background message: ${message.notification?.title} - ${message.notification?.body}");
    // Handle background notifications (like updating the UI or displaying local notifications)
  }

  // Configure local time zone
  Future<void> _configureLocalTimeZone() async {
    print("🌍 Configuring local timezone...");
    tz.initializeTimeZones();
    final String timeZoneName = await FlutterTimezone.getLocalTimezone();
    tz.setLocalLocation(tz.getLocation(timeZoneName));
    print("✅ Timezone configured: $timeZoneName");
  }

  // Request notification permissions
  Future<void> _requestPermissions() async {
    print("🔔 Requesting notification permissions...");
    final status = await Permission.notification.request();
    if (status.isDenied || status.isPermanentlyDenied) {
      print("⚠ Notifications Denied. Opening App Settings...");
      openAppSettings();
    } else {
      print("✅ Notifications Allowed!");
    }
  }

  // Create notification channels for Android
  Future<void> _createNotificationChannels() async {
    print("📢 Creating notification channels...");
    final AndroidFlutterLocalNotificationsPlugin? androidPlugin = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();

    if (androidPlugin != null) {
      const AndroidNotificationChannel instantChannel = AndroidNotificationChannel(
        'instant_notification_channel',
        'Instant Notifications',
        description: 'Channel for instant notifications',
        importance: Importance.max,
      );

      const AndroidNotificationChannel periodicChannel = AndroidNotificationChannel(
        'periodic_notification_channel',
        'Periodic Notifications',
        description: 'Channel for periodic notifications every 1 hour',
        importance: Importance.max,
      );

      const AndroidNotificationChannel dailyTipChannel = AndroidNotificationChannel(
        'daily_tip_notification_channel',
        'Daily Tips',
        description: 'Channel for daily tips at 9 AM',
        importance: Importance.max,
      );

      await androidPlugin.createNotificationChannel(instantChannel);
      await androidPlugin.createNotificationChannel(periodicChannel);
      await androidPlugin.createNotificationChannel(dailyTipChannel);
    }
    print("✅ Notification channels created!");
  }

  // Show notification when receiving an FCM message
  Future<void> _showNotificationFromMessage(RemoteMessage message) async {
    const AndroidNotificationDetails androidNotificationDetails = AndroidNotificationDetails(
      'instant_notification_channel',
      'Instant Notifications',
      channelDescription: 'Channel for instant notifications',
      importance: Importance.max,
      priority: Priority.high,
      ticker: 'ticker',
    );
    const NotificationDetails notificationDetails = NotificationDetails(android: androidNotificationDetails);

    await flutterLocalNotificationsPlugin.show(
      0,
      message.notification?.title,
      message.notification?.body,
      notificationDetails,
    );
  }

  // Show an instant notification (manual trigger)
  Future<void> showInstantNotification() async {
    print("🔔 Attempting to show instant notification...");

    const AndroidNotificationDetails androidNotificationDetails = AndroidNo


ool MCQTInit(void);
static void MCQTFinit(void);

//////////

extern "C" int initialise_weak_link_QuickTime(void);
extern "C" int initialise_weak_link_QTKit(void);
extern "C" int initialise_weak_link_QuickDraw(void);

/////////

bool MCQTInitialize(void)
{
	if (s_qt_initted)
		return true;

#ifdef _WINDOWS
	if (InitializeQTML(0L) != noErr || EnterMovies() != noErr)
		s_qt_initted = false;
	else
	{
		s_qt_initted = true;
	}
#elif defined _MACOSX
    if (initialise_weak_link_QuickTime() == 0 ||
        initialise_weak_link_QTKit() == 0 ||
        initialise_weak_link_QuickDraw() == 0)
    {
        s_qt_initted = false;
        return false;
    }

	if (EnterMovies() != noErr)
		s_qt_initted = false;
	else
	{
		s_qt_initted = true;
	}
#endif

	return s_qt_initted;
}

bool MCQTInit(void)
{
	if (MCdontuseQT)
		return false;

	return MCQTInitialize();
}

void MCQTFinit(void)
{
	if (qteffects != NULL)
	{
		uint2 i;
		for (i=0;i < neffects; i++)
			delete qteffects[i].token;
		delete qteffects;
		qteffects = NULL;
		neffects = 0;
	}
}

void MCQTGetVersion(MCStringRef& r_version)
{
    if (!MCQTInit())
    {
        r_version = MCValueRetain(MCSTR("0.0"));
        return;
    }

    long attrs;
    if (Gestalt(gestaltQuickTimeVersion, &attrs) == noErr)
        /* UNCHECKED */ MCStringFormat(r_version, "%ld.%ld.%ld", attrs >> 24, (attrs >> 20) & 0xF, (attrs >> 16) & 0xF);
    else
        r_version = MCValueRetain(MCSTR("0.0"));  //indicates that no QT installed
}

////////////////////////////////////////////////////////////////////////////////

#ifndef FEATURE_PLATFORM_RECORDER
// Related class variables
static void *sgSoundComp = NULL;
static long sgSndDriver = 0;
static MCStringRef recordtempfile = NULL;
static MCStringRef recordexportfile = NULL;

#ifdef _MACOSX
#define AUDIO_MEDIA_TYPE SGAudioMediaType
#else
#define AUDIO_MEDIA_TYPE SoundMediaType
#endif

// Utility functions
static SampleDescriptionHandle scanSoundTracks(Movie tmovie)
{
	short trackCount, index;
	SampleDescriptionHandle aDesc = NULL;
	trackCount = (short)GetMovieTrackCount(tmovie);
	for (index = 1 ; index <= trackCount ; index++)
	{
		OSType aTrackType;
		Track aTrack = NULL;
		Media aMedia = NULL;
		aTrack = GetMovieIndTrack(tmovie, index);
		aMedia = GetTrackMedia(aTrack);
		GetMediaHandlerDescription(aMedia, &aTrackType, 0, 0);
		if (aTrackType == AUDIO_MEDIA_TYPE)
		{
			aDesc = (SampleDescriptionHandle)NewHandle(sizeof(SoundDescription));
			GetMediaSampleDescription(aMedia, 1, aDesc);
			if (GetMoviesError() != noErr)
			{
				DisposeHandle((Handle)aDesc);
				aDesc = NULL;
				continue;
			}
		}
	}
	return aDesc;
}

static bool path_to_dataref(MCStringRef p_path, DataReferenceRecord& r_rec)
{
	bool t_success = true;
	CFStringRef t_cf_path = NULL;
	t_cf_path = CFStringCreateWithCString(NULL, MCStringGetCString(p_path),


// valkey exporter
	ValkeyExporter *ChangeAgentOKBodyValkeyExporter `json:"valkey_exporter,omitempty"`
}

// Validate validates this change agent OK body
func (o *ChangeAgentOKBody) Validate(formats strfmt.Registry) error {
	var res []error

	if err := o.validateAzureDatabaseExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateExternalExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateMongodbExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateMysqldExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateNodeExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateNomadAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validatePostgresExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateProxysqlExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateQANMongodbMongologAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateQANMongodbProfilerAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateQANMysqlSlowlogAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRDSExporter(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateValkeyExporter(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *ChangeAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error {
	if swag.IsZero(o.AzureDatabaseExporter) { // not required
		return nil
	}

	if o.AzureDatabaseExporter != nil {
		if err := o.AzureDatabaseExporter.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("changeAgentOk" + "." + "azure_database_exporter")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("changeAgentOk" + "." + "azure_database_exporter")
			}
			return err
		}
	}

	return nil
}

func (o *ChangeAgentOKBody) validateExternalExporter(formats strfmt.Registry) error {
	if swag.IsZero(o.ExternalExporter) { // not required
		return nil
	}

	if o.ExternalExporter != nil {
		if err := o.ExternalExporter.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("changeAgentOk" + "." + "external_exporter")
			} else if ce, ok := err.(*errors.CompositeError); ok {


>,
}

impl Context {
    pub fn redis(&self) -> RefMut<PooledRedis> {
        self.redis.borrow_mut()
    }

    pub fn pg(&self) -> &PooledPg {
        &self.pg
    }

    fn new(pg: PooledPg, redis: PooledRedis) -> Self {
        Self {
            pg,
            redis: RefCell::new(redis),
        }
    }
}

impl<'a, 'r> FromRequest<'a, 'r> for Context {
    type Error = ();

    fn from_request(request: &'a Request<'r>) -> Outcome<Self, Self::Error> {
        let pg_pool = request.guard::<State<PoolPg>>()?;
        let redis_pool = request.guard::<State<PoolRedis>>()?;

        let pg_conn = match pg_pool.get() {
            Ok(pg_conn) => pg_conn,
            Err(error) => return Outcome::Failure((Status::ServiceUnavailable, ())),
        };

        let redis_conn = match redis_pool.get() {
            Ok(redis_conn) => redis_conn,
            Err(error) => return Outcome::Failure((Status::ServiceUnavailable, ())),
        };

        Outcome::Success(Context::new(pg_conn, redis_conn))
    }
}

impl juniper::Context for Context {}
pub mod file;
pub mod print;
<filename>build.rs<gh_stars>1-10
extern crate serde;
extern crate serde_yaml;
extern crate serde_json;

use std::collections::BTreeMap;
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use std::io;

fn main() -> io::Result<()> {
    let project_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
    let versions_path = Path::new(&project_dir).join("versions.yml");
    let versions = File::open(&versions_path).unwrap();
    let version_list: BTreeMap<String, String> = serde_yaml::from_reader(versions).unwrap();

    let out_dir = env::var("OUT_DIR").unwrap();
    let routes_path = Path::new(&out_dir).join("version_routes.rs");
    let versions_path = Path::new(&out_dir).join("versions.rs");

    let mut f = File::create(&routes_path).unwrap();

    writeln!(f, "pub fn _add_version_routes(router:&mut Router) {{")?;
    writeln!(f, r#"    debug!("add unity version routes");"#)?;
    writeln!(f, r#"    versions_routes!(router,"#)?;
    for item in &version_list {
        writeln!(f, r#"        "{}" => "{}","#, item.0, item.1)?;
    }
    writeln!(f, "    );")?;
    writeln!(f, "}}")?;

    let mut f = File::create(&versions_path).unwrap();

    writeln!(f, "const VERSIONS: &str = r#\"")?;
    writeln!(f, "{}", serde_json::to_string_pretty(&version_list).unwrap())?;
    writeln!(f, "\"#;")?;
    Ok(())
}

pub const POLKADOT_GENESIS_HASH: &'static str = "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3";
pub const KUSAMA_GENESIS_HASH: &'static str = "0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe";

#[derive(Clone, Eq, PartialEq, Debug, Copy)]
pub enum Network {


	<script egret="game" src="bin-debug/Main.js"></script>
	<script egret="game" src="bin-debug/componentExt/LoadingPanel.js"></script>
	<script egret="game" src="bin-debug/core/views/BasePanel.js"></script>
	<script egret="game" src="bin-debug/componentExt/ShareIconPanel.js"></script>
	<script egret="game" src="bin-debug/componentExt/WaitPanel.js"></script>
	<script egret="game" src="bin-debug/core/component/AlertPanel.js"></script>
	<script egret="game" src="bin-debug/core/component/EButton.js"></script>
	<script egret="game" src="bin-debug/core/component/ETabBar.js"></script>
	<script egret="game" src="bin-debug/core/component/ETextField.js"></script>
	<script egret="game" src="bin-debug/core/component/EToggleButton.js"></script>
	<script egret="game" src="bin-debug/core/component/EToggleSwitch.js"></script>
	<script egret="game" src="bin-debug/core/component/ShareIconRender.js"></script>
	<script egret="game" src="bin-debug/core/component/TipsManager.js"></script>
	<script egret="game" src="bin-debug/core/component/TipsPanel.js"></script>
	<script egret="game" src="bin-debug/core/config/GameConfig.js"></script>
	<script egret="game" src="bin-debug/core/data/GlobalData.js"></script>
	<script egret="game" src="bin-debug/core/data/PropertiesAnalyzer.js"></script>
	<script egret="game" src="bin-debug/core/net/Network.js"></script>
	<script egret="game" src="bin-debug/core/net/SocketManager.js"></script>
	<script egret="game" src="bin-debug/core/notification/MainNotify.js"></script>
	<script egret="game" src="bin-debug/core/utils/EffectUtils.js"></script>
	<script egret="game" src="bin-debug/core/utils/Global.js"></script>
	<script egret="game" src="bin-debug/core/utils/NativeApi.js"></script>
	<script egret="game" src="bin-debug/core/utils/RegUtils.js"></script>
	<script egret="game" src="bin-debug/core/utils/UtilsClass/BitmapBlink.js"></script>
	<script egret="game" src="bin-debug/core/utils/UtilsClass/LEvent.js"></script>
	<script egret="game" src="bin-debug/core/utils/UtilsClass/LListener.js"></script>
	<script egret="game" src="bin-debug/core/utils/UtilsClass/TipsUtils.js"></script>
	<script egret="game" src="bin-debug/core/utils/md5.js"></script>
	<script egret="game" src="bin-debug/core/views/GameScene.js"></script>
	<script egret="game" src="bin-debug/core/views/PanelManager.js"></script>
	<script egret="game" src="bin-debug/core/views/PopUpManager.js"></script>
	<script egret="game" src="bin-debug/view/GameOverPanel.js"></script>
	<script egret="game" src="bin-debug/view/GamePanel.js"></script>
	<script egret="game" src="bin-debug/view/SharePanel.js"></script>
	<script egret="game" src="bin-debug/view/StartPanel.js"></script>
	<!--game_files_end-->
</head>
<body>

    <div style="margin: auto;width: 100%;height: 100%;" cl


 12z",
          "M14.96 18.96 8 12l6.96-6.96.71.71L9.41 12l6.25 6.25-.7.71z":"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",
          /* X (close) */
          "M12.7,12l6.6,6.6l-0.7,0.7L12,12.7l-6.6,6.6l-0.7-0.7l6.6-6.6L4.6,5.4l0.7-0.7l6.6,6.6l6.6-6.6l0.7,0.7L12.7,12z":"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",
          "m12.71 12 8.15 8.15-.71.71L12 12.71l-8.15 8.15-.71-.71L11.29 12 3.15 3.85l.71-.71L12 11.29l8.15-8.15.71.71L12.71 12z":"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",
          /* */
          "M21 11v1H5.64l6.72 6.72-.71.71-7.93-7.93 7.92-7.92.71.71L5.64 11H21z":"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",
          /* Show more */
          "m18 9.28-6.35 6.35-6.37-6.35.72-.71 5.64 5.65 5.65-5.65z":"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z",
          "M12,15.7L5.6,9.4l0.7-0.7l5.6,5.6l5.6-5.6l0.7,0.7L12,15.7z":"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z",
          /* Show fewer */
          "M18.4 14.6 12 8.3l-6.4 6.3.8.8L12 9.7l5.6 5.7z":"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",
      }

      arrowIconsNoColor = {
      }

      searchPageIcons = {
          "M15 17h6v1h-6v-1zm-4 0H3v1h8v2h1v-5h-1v2zm3-9h1V3h-1v2H3v1h11v2zm4-3v1h3V5h-3zM6 14h1V9H6v2H3v1h3v2zm4-2h11v-1H10v1z": "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"
      }

      playlist


.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! This script uses millennium-bindings-cxx to generate C++ bindings for Millennium based on patterns analyzed from
//! your C++ code. You shouldn't have to modify any of the logic in here, Millennium will do that for you. Just modify
//! the settings below to match your project setup.
//!
//! The generated C/C++ header file is included in the `target` folder relative to the `build.rs` file. The generated
//! libraries (both static and shared) are included in the `target/{config}` folder relative to the `build.rs` file,
//! where {config} is the Rust target configuration (`debug` or `release`).
//!
//! This crate can be cross-compiled:
//! ```bash
//! $ rustup target add x86_64-unknown-linux-gnu
//! $ rustup toolchain install stable-x86_64-unknown-linux-gnu
//! $ cargo build --target x86_64-unknown-linux-gnu
//! ```
//!
//! To build a release build (with size optimizations), run `cargo build --release`.
//!
//! On Windows, you need to link to the following libraries (if you are not using the CMake script):
//! ```plaintext
//! user32.lib kernel32.lib gdi32.lib shell32.lib advapi32.lib bcrypt.lib ws2_32.lib imm32.lib userenv.lib oleaut32.lib
//! dwmapi.lib comctl32.lib uxtheme.lib WebView2LoaderStatic.lib
//! ```
//!
//! WebView2LoaderStatic.lib can be found in the `Microsoft.Web.WebView2` NuGet package, which you can download
//! at https://www.nuget.org/packages/Microsoft.Web.WebView2/. The library is found under `build/native/{arch}/`, and
//! you can use 7-Zip to extract it from the nupkg file.

/// The path to your .millenniumrc config file relative to the `build.rs` file. For most projects, this is
/// `../.millenniumrc`. Note that these bindings do **not** support platform-specific configuration files. If you need
/// conditional configuration for platforms, you can use something like the following:
///
/// ```rust
/// #[cfg(target_os = "macos")]
/// pub const MILLENNIUMRC_PATH: &str = "../.millenniumrc.macos";
/// #[cfg(target_os = "linux")]
/// pub const MILLENNIUMRC_PATH: &str = "../.millenniumrc.linux";
/// #[cfg(target_os = "windows")]
/// pub const MILLENNIUMRC_PATH: &str = "../.millenniumrc.windows";
/// ```
pub const MILLENNIUMRC_PATH: &str = "../.millenniumrc";
/// The path(s) to your C/C++ source code relative to the `build.rs` file.
/// This will be scanned by millennium-bindings-cxx to generate bindings.
/// In Rust, commands (among other things) are generated at compile time using Rust macros. Because we have to build the
/// Rust library before building C++, we have to scan the C++ beforehand to see what commands are being registered. The
/// C++ parsing is not at all perfect and is not context-aware, so be careful when using macro


try = (Map.Entry<Object, Object>) iterator.next();
			map.put(entry.getKey().toString(), entry.getValue() == null ? "" : entry.getValue().toString().trim());
		}
		return map;

	}

	public static boolean isInnerIP(String ipAddress) {
		boolean isInnerIp = false;
		long ipNum = getIpNum(ipAddress);
		/**
		 * 私有IP：A类 10.0.0.0-10.255.255.255 B类 172.16.0.0-172.31.255.255 C类 192.168.0.0-192.168.255.255 当然，还有127这个网段是环回地址
		 **/
		long aBegin = getIpNum("10.0.0.0");
		long aEnd = getIpNum("10.255.255.255");
		long bBegin = getIpNum("172.16.0.0");
		long bEnd = getIpNum("172.31.255.255");
		long cBegin = getIpNum("192.168.0.0");
		long cEnd = getIpNum("192.168.255.255");
		isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || ipAddress.equals("127.0.0.1");
		return isInnerIp;
	}

	private static long getIpNum(String ipAddress) {
		String[] ip = ipAddress.split("\\.");
		long a = Integer.parseInt(ip[0]);
		long b = Integer.parseInt(ip[1]);
		long c = Integer.parseInt(ip[2]);
		long d = Integer.parseInt(ip[3]);

		long ipNum = a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
		return ipNum;
	}

	private static boolean isInner(long userIp, long begin, long end) {
		return (userIp >= begin) && (userIp <= end);
	}

	/**
	 * 将下划线大写方式命名的字符串转换为驼峰式。
	 * 如果转换前的下划线大写方式命名的字符串为空，则返回空字符串。</br>
	 * 例如：hello_world->helloWorld
	 *
	 * @param name
	 *            转换前的下划线大写方式命名的字符串
	 * @return 转换后的驼峰式命名的字符串
	 */
	public static String camelName(String name) {
		StringBuilder result = new StringBuilder();
		// 快速检查
		if (name == null || name.isEmpty()) {
			// 没必要转换
			return "";
		} else if (!name.contains("_")) {
			// 不含下划线，仅将首字母小写
			//update-begin--Author:zhoujf  Date:20180503 for：TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
			//update-begin--Author:zhoujf  Date:20180503 for：TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
			return name.substring(0, 1).toLowerCase() + name.substring(1).toLowerCase();
			//update-end--Author:zhoujf  Date:20180503 for：TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
		}
		// 用下划线将原始字符串分割
		String camels[] = name.split("_");
		for (String camel : camels) {
			// 跳过原始字符串中开头、结尾的下换线或双重下划线
			if (camel.isEmpty()) {
				continue;
			}
			// 处理真正的驼峰片段
			if (result.length() == 0) {
				// 第一个驼峰片段，全部字母都小写
				result.append(camel.toLowerCase());
			} else {
				// 其他的驼峰片段，首字


FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

       The author may be contacted at:
           t2ti.com@gmail.com

@author Albert Eije (alberteije@gmail.com)
@version 1.0.0
*******************************************************************************/

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:pegasus_pdv/src/controller/controller.dart';
import 'package:pegasus_pdv/src/database/database_classes.dart';
import 'package:pegasus_pdv/src/database/database.dart';
import 'package:pegasus_pdv/src/infra/infra.dart';

class CardapioDetalhePage extends StatefulWidget {
  final ProdutoMontado produtoMontado;

  const CardapioDetalhePage(this.produtoMontado, {Key? key}) : super(key: key);

  @override
  CardapioDetalhePageState createState() => CardapioDetalhePageState();
}

class CardapioDetalhePageState extends State<CardapioDetalhePage> {

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      backgroundColor: Color.lerp(Colors.grey[850], Colors.blueGrey, 0.8),
      body: _getCorpo(),
    );
  }

  Widget _getCorpo() {
    return ListView(
      controller: ScrollController(),
      padding: const EdgeInsets.only(top: 0.0),
      children: [

        Stack(
          children: [
            Container(
              color: Color.lerp(Colors.grey[850], Colors.white, 0.4),
              height: 60,
            ),
            const SizedBox(
              height: 10,
            ),
            Positioned(
              top: 20,
              left: 60,
              child: Text("Detalhes: ${widget.produtoMontado.produto!.nome!}",
                style: TextStyle(
                  color: Colors.grey.shade300,
                  fontSize: Biblioteca.isTelaPequena(context)! ? 14.0 : 16.0,
                  fontWeight: FontWeight.bold
                ),
              ),
            ),
            Positioned(
              top: 10,
              left: 10,
              child: IconButton(
                tooltip: 'Voltar',
                icon: const Icon(Icons.arrow_back_outlined),
                onPressed: () { Navigator.pop(context); },
              ),
            ),
          ],
        ),

        CustomScrollView(
          shrinkWrap: true,
          slivers: <Widget>[
            gridComImagens(),
          ],
        ),

        ListTile(
          contentPadding: const EdgeInsets.only(top: 5, bottom: 5, left: 5, right: 15),
          leading: const Wrap(
            spacing: 12,
            children: [
              SizedBox(width: 1,),
              Icon(
                FontAwesomeIcons.dochub,
                color: Colors.black54,
              ),
            ]
          ),
          title: Text("Descrição do Produto",
            style: TextStyle(
              color: Colors.grey.shade300,
              fontSize: Biblioteca.isTelaPequena(context)! ? 14.0 : 16.0,
              fontWeight: FontWeight.bold
            ),
          ),
        ),

        Padding(
          padding: const EdgeInsets.only(top: 0, bottom: 5, left: 20, right: 5),
          child: Text(widget.produtoMontado.produto!.descricao ?? "Cadastre a descrição do produto",
            style: TextStyle(
              color: Colors.yellow.shade300,
              fontSize: Biblioteca.isTelaPequena(context)! ? 14.0 : 16.0,
              fontWeight: FontWeight.bold
            ),
          ),
        ),
      ],
    );
  }

  // TODO: o código abaixo se repete (no todo ou em parte) em produto_persiste_page
  /// ==================================================================================================================


(r1)
/* 802C38A8 002BF508  7C 08 02 A6 */	mflr r0
/* 802C38AC 002BF50C  3C 60 80 57 */	lis r3, lbl_80568B78@ha
/* 802C38B0 002BF510  90 01 00 14 */	stw r0, 0x14(r1)
/* 802C38B4 002BF514  38 63 8B 78 */	addi r3, r3, lbl_80568B78@l
/* 802C38B8 002BF518  93 E1 00 0C */	stw r31, 0xc(r1)
/* 802C38BC 002BF51C  3B E3 00 34 */	addi r31, r3, 0x34
/* 802C38C0 002BF520  93 C1 00 08 */	stw r30, 8(r1)
/* 802C38C4 002BF524  3B C0 00 00 */	li r30, 0
lbl_802C38C8:
/* 802C38C8 002BF528  88 1F 01 19 */	lbz r0, 0x119(r31)
/* 802C38CC 002BF52C  2C 00 00 00 */	cmpwi r0, 0
/* 802C38D0 002BF530  41 82 00 10 */	beq lbl_802C38E0
/* 802C38D4 002BF534  A0 7F 00 00 */	lhz r3, 0(r31)
/* 802C38D8 002BF538  38 80 00 03 */	li r4, 3
/* 802C38DC 002BF53C  48 01 44 3D */	bl l2c_link_hci_disc_comp
lbl_802C38E0:
/* 802C38E0 002BF540  3B DE 00 01 */	addi r30, r30, 1
/* 802C38E4 002BF544  3B FF 01 1C */	addi r31, r31, 0x11c
/* 802C38E8 002BF548  28 1E 00 04 */	cmplwi r30, 4
/* 802C38EC 002BF54C  41 80 FF DC */	blt lbl_802C38C8
/* 802C38F0 002BF550  80 01 00 14 */	lwz r0, 0x14(r1)
/* 802C38F4 002BF554  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 802C38F8 002BF558  83 C1 00 08 */	lwz r30, 8(r1)
/* 802C38FC 002BF55C  7C 08 03 A6 */	mtlr r0
/* 802C3900 002BF560  38 21 00 10 */	addi r1, r1, 0x10
/* 802C3904 002BF564  4E 80 00 20 */	blr

.global BTM_SwitchRole
BTM_SwitchRole:
/* 802C3908 002BF568  94 21 FF D0 */	stwu r1, -0x30(r1)
/* 802C390C 002BF56C  7C 08 02 A6 */	mflr r0
/* 802C3910 002BF570  90 01 00 34 */	stw r0, 0x34(r1)
/* 802C3914 002BF574  39 61 00 30 */	addi r11, r1, 0x30
/* 802C3918 002BF578  4B F0 38 11 */	bl _savegpr_27
/* 802C391C 002BF57C  3C C0 80 57 */	lis r6, lbl_80568B78@ha
/* 802C3920 002BF580  7C 7C 1B 78 */	mr r28, r3
/* 802C3924 002BF584  38 C6 8B 78 */	addi r6, r6, lbl_80568B78@l
/* 802C3928 002BF588  7C 9D 23 78 */	mr r29, r4
/* 802C392C 002BF58C  88 06


ci,
    Uhci,
    Ehci,
    Xhci,
}

impl Display for UsbBus {
    fn fmt(&self, f: &mut Formatter) -> FmtResult {
        f.write_str(match self {
            &UsbBus::Ohci => "ohci",
            &UsbBus::Uhci => "uhci",
            &UsbBus::Ehci => "ehci",
            &UsbBus::Xhci => "xhci",
        })
    }
}

impl Default for UsbBus {
    fn default() -> Self {
        UsbBus::Xhci
    }
}

#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct UsbDevice {
    pub binding: UsbBinding,
    #[serde(default = "default_usbdevice_permanent")]
    pub permanent: bool,
    #[serde(default = "default_usbdevice_bus")]
    pub bus: UsbBus,
}

pub fn default_usbdevice_permanent() -> bool {
    false
}

pub fn default_usbdevice_bus() -> UsbBus {
    UsbBus::Xhci
}

#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct HotKey {
    pub key: KeyBinding,
    pub action: HotKeyAction,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub enum HotKeyAction {
    Exec(String),
    Action(Action),
}

#[derive(Deserialize, Serialize, Debug, Clone, Copy)]
pub enum Action {
    IoUpgrade,
    IoEntryForced,
    IoExit,
}

#[derive(Deserialize, Serialize, Debug, Clone, Default)]
pub struct Config {
    pub machine: MachineConfig,
    pub sound: SoundConfig,
    pub samba: Option<SambaConfig>,
    pub setup: Option<SetupConfig>,
    pub additional_qemu_cmdline: Option<String>,
    pub runtime_directory_override: Option<String>,
    pub data_directory_override: Option<String>,
    pub hooks: HooksConfig,
}

// TODO: maybe using run-parts would be a more flexible solution here?
#[derive(Deserialize, Serialize, Debug, Clone, Default)]
#[serde(default)]
pub struct HooksConfig {
    pub ready: Option<String>,
    pub attach: Option<String>,
    pub detach: Option<String>,
    pub down: Option<String>,
}

#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(default)]
pub struct SoundConfig {
    pub timer_period: usize,
    pub input: SoundSettings,
    pub output: SoundSettings,
    pub backend: SoundBackend,
}

impl Default for SoundConfig {
    fn default() -> SoundConfig {
        SoundConfig {
            timer_period: 100,
            input: SoundSettings::default(),
            output: SoundSettings::default(),
            backend: SoundBackend::default(),
        }
    }
}

#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(default)]
pub struct SoundSettings {
    pub voices: usize,
    pub use_polling: bool,
    pub fixed: Option<SoundFixedSettings>,
}

impl Default for SoundSettings {
    fn default() -> SoundSettings {
        SoundSettings {
            voices: 1,
            use_polling: true,
            fixed: None,
        }
    }
}

#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct SoundFixedSettings {
    pub frequency: usize,
    pub format: String,
    pub channels: usize,
}

#[derive(Deserialize, Serialize, Debug, Clone)]
pub enum SoundBackend {
    None,

    Alsa {
        sink: AlsaSettings,
        source: AlsaSettings,
    },

    PulseAudio {
        buffer_samples: usize,


   // dxgmms2.sys .text:0x2cf40, 0x1c52 bytes
    //
    _q00(sdk::unknown_ptr) log_page_fault_information;

    // [NotifyAllocationReclaimed]
    // Ldr = [dxgmms2.sys]
    // => Windows 10 v1607, Windows 10 v2004, Windows 11, Windows 10 v20H2
    // dxgmms2.sys PAGE:0x669e0, 0x158b bytes
    // dxgmms2.sys PAGE:0xb2c70, 0x1c52 bytes
    // dxgmms2.sys PAGE:0xd8bd0, 0x20ba bytes
    // dxgmms2.sys PAGE:0xb3240, 0x1c52 bytes
    //
    _q01(sdk::unknown_ptr) notify_allocation_reclaimed;

    // [ReportGpuVirtualAddressAllocator]
    // Ldr = [dxgmms2.sys]
    // => Windows 10 v1607, Windows 10 v2004, Windows 11, Windows 10 v20H2
    // dxgmms2.sys .rdata:0x2b510, 0x158b bytes
    // dxgmms2.sys .rdata:0x445c0, 0x1c52 bytes
    // dxgmms2.sys .rdata:0x4f120, 0x20ba bytes
    // dxgmms2.sys .rdata:0x445c0, 0x1c52 bytes
    //
    _q02(sdk::unknown_ptr) report_gpu_virtual_address_allocator;

    // [ReportGpuVirtualAddressRange]
    // Ldr = [dxgmms2.sys]
    // => Windows 10 v1607, Windows 10 v2004, Windows 11, Windows 10 v20H2
    // dxgmms2.sys .rdata:0x2b6a0, 0x158b bytes
    // dxgmms2.sys .rdata:0x448a0, 0x1c52 bytes
    // dxgmms2.sys .rdata:0x4f440, 0x20ba bytes
    // dxgmms2.sys .rdata:0x448a0, 0x1c52 bytes
    //
    _q03(sdk::unknown_ptr) report_gpu_virtual_address_range;

    // [ReportGpuVirtualAddressRangeMapping]
    // Ldr = [dxgmms2.sys]
    // => Windows 10 v1607, Windows 10 v2004, Windows 11, Windows 10 v20H2
    // dxgmms2.sys .rdata:0x2b480, 0x158b bytes
    // dxgmms2.sys .rdata:0x44510, 0x1c52 bytes
    // dxgmms2.sys .rdata:0x4f050, 0x20ba bytes
    // dxgmms2.sys .rdata:0x44510, 0x1c52 bytes
    //
    _q04(sdk::unknown_ptr) report_gpu_virtual_address_range_mapping;

    // [TotalBytesResidentInSegment]
    // Ldr = [dxgmms2.sys]
    // => Windows 10 v1607, Windows 10 v2004, Windows 11, Windows 10 v20H2
    // dxgmms2.sys .rdata:0x2a148, 0x158b bytes
    // dxgmms2.sys .rdata:0x42bb0, 0x1c52 bytes
    // dxgmms2.sys .rdata:0x4bb88, 0x20ba bytes
    // dxgmms2.sys .rdata:0x42a70, 0x1c52 bytes
    //
    _q05(sdk::unknown_ptr) total_bytes_resident_in_segment;

    // [UpdateGpuVirtualAddressRangeMapping]
    // Ldr = [dxgmms2.sys]
    // => Windows 10 v1607, Windows 10 v2004, Windows 11, Windows 10 v20H2
    // dxgmms2.sys .rdata:0x2b470, 0x158b bytes
    // dx