         eventChannel.emit('changeRoomSuccess', room_id);
            wx.navigateBack();
            break;
          default:
        }
      }
    })
  }
})const app = getApp();
Page({
  data: {
    bbbug: false,
    roomInfo: false,
    room_type_index: 0,
    room_addsong_index: 0,
    room_sendmsg_index: 0,
    room_public_index: 0,
    room_playone_index: 0,
    room_type: [{
      id: 0,
      name: "普通聊天房"
    }, {
      id: 1,
      name: "点歌音乐房"
    }, {
      id: 4,
      name: "房主电台房"
    }],
    room_addsong: [{
      value: 0,
      title: "所有人可点歌"
    }, {
      value: 1,
      title: "仅房主可点歌"
    }],
    room_sendmsg: [{
      value: 0,
      title: "关闭全员禁言"
    }, {
      value: 1,
      title: "开启全员禁言"
    }],
    room_public: [{
      value: 0,
      title: "公开房间"
    }, {
      value: 1,
      title: "加密房间"
    }],
    room_playone: [{
      value: 0,
      title: "随机播放"
    }, {
      value: 1,
      title: "单曲循环"
    }],
    room_robot: [{
      value: 0,
      title: "开启机器人点歌"
    }, {
      value: 1,
      title: "关闭机器人点歌"
    }],
    room_playone: [{
      value: 0,
      title: "随机播放"
    }, {
      value: 1,
      title: "单曲循环"
    }],
    room_votepass: [{
      value: 0,
      title: "关闭投票切歌"
    }, {
      value: 1,
      title: "打开投票切歌"
    }],
    room_votepercent: [{
      value: 20,
      title: "20%"
    }, {
      value: 30,
      title: "30%"
    }, {
      value: 40,
      title: "40%"
    }, {
      value: 50,
      title: "50%"
    }, {
      value: 60,
      title: "60%"
    }, ],
    room_addsong: [{
      value: 0,
      title: "所有人可点歌"
    }, {
      value: 1,
      title: "仅管理员点歌"
    }],
    room_sendmsg: [{
      value: 0,
      title: "所有人可发言"
    }, {
      value: 1,
      title: "仅管理可发言"
    }, {
      value: 2,
      title: "仅管理嘉宾可发言"
    }]
  },
  onLoad: function (options) {
    if (!options.bbbug || options.bbbug != app.globalData.systemVersion) {
      return;
    }
    this.setData({
      bbbug: true
    });
    wx.setNavigationBarTitle({
      title: '修改房间信息',
    });
  },
  onShow: function () {
    let room_type_index = 0;
    let that = this;
    switch (app.globalData.roomInfo.room_type) {
      case 1:
        room_type_index = 1;
        break;
      case 4:
        room_type_index = 2;
        break;
      default:
    }
    let room_addsong_index = 0;
    switch (app.globalData.roomInfo.room_addsong) {
      case 0:
        room_addsong_index = 0;
        break;
      case 1:
        room_addsong_index = 1;
        break;
      default:
    }
    let room_sendmsg_index = 0;
    switch (app.globalData.roomInfo.room_sendmsg) {
      case 0:
        room_sendmsg_index = 0


ly/')) {
      if(storeRelease) { // sur les stores, on permet pas de télécharger depuis ces services
        Haptic().warning();
        showSnackBar(context, "Le store de votre appareil n'autorise pas le téléchargement depuis ce service", icon: "warning", useCupertino: widget.useCupertino);
        return;
      }
      service = 'cobalt';
    }
    else if (downloadKey.startsWith('https://mediafire.com/file/') || downloadKey.startsWith('https://www.mediafire.com/file/')) {
      service = 'mediafire';
    }

    // Afficher un avertissement sur un service tiers
    if (service != 'stend') {
      var alreadyWarned = box.read('warnedAboutThirdPartyService') ?? false;
      if (!alreadyWarned) {
        box.write('warnedAboutThirdPartyService', true);
        await asyncActionsDialog(
          context,
          title: "Service tiers",
          content: "Vous êtes sur le point de télécharger un fichier depuis un service tiers. Certaines fonctionnalités peuvent ne pas être implémentées ou ne pas fonctionner correctement.",
          actions: [
            TextButton(
              onPressed: () {
                Haptic().light();
                Navigator.pop(context);
              },
              child: const Text("Continuer"),
            )
          ]
        );
      }
    }

    // Afficher une alerte
    if (!mounted) return;
    downloadAlertTupple = const Tuple3("Préparation...", null, null);
    showAdaptiveDialog(
      barrierDismissible: false,
      context: context,
      builder: (BuildContext context) {
        return StreamBuilder(
          stream: downloadAlertStreamController.stream,
          initialData: downloadAlertTupple,
          builder: (BuildContext context, AsyncSnapshot snapshot) {
            String content = snapshot.data.item1;
            double? value = snapshot.data.item2;
            String? fileType = snapshot.data.item3;
            return PopScope(
              canPop: false,
              child: DownloadDialog(useCupertino: widget.useCupertino, content: content, value: value, fileType: fileType)
            );
          }
        );
      }
    );

    // Client Stend - on obtient le lien de l'API
    if (service == 'stend') {
      if (downloadKey.startsWith("http://") || downloadKey.startsWith("https://")) {
        Response response;

        try {
          var cancelToken = CancelToken();

          // Faire une requête pour obtenir l'URL de l'API avec une limite de 8 Mo
          response = await dio.get(downloadKey,
            cancelToken: cancelToken,
            onReceiveProgress: (received, total) {
              if (total > 8000000 || received > 8000000) {
                cancelToken.cancel();
              }
            },
            options: Options(
              followRedirects: false,
              validateStatus: (status) {
                return status! < 500;
              }
            )
          );
          while (response.isRedirect) {
            String location = response.headers.value('location')!;
            downloadKey = response.requestOptions.uri.toString();
            if (location.startsWith("/")) location = '${downloadKey.split("/")[0]}//${downloadKey.split("/")[2]}$location';
            if (location.endsWith('=')) location = location.substring(0, location.length - 1);
            var cancelToken = CancelToken();
            response = await dio.get(location,
              cancelToken: cancelToken,
              onReceiveProgress: (received, total) {
                if (total > 8000000 || received > 8000000) {
                  cancelToken.cancel();
                }
              },


_format='channels_last'.
        `rows` and `cols` values might have changed due to stride.

    # Returns
        Output tensor of block.
    """
    channel_axis = 1 if backend.image_data_format() == 'channels_first' else -1
    pointwise_conv_filters = int(pointwise_conv_filters * alpha)

    if strides == (1, 1):
        x = inputs
    else:
        x = layers.ZeroPadding2D(((0, 1), (0, 1)),
                                 name='conv_pad_%d' % block_id)(inputs)
    x = layers.DepthwiseConv2D((3, 3),
                               padding='same' if strides == (1, 1) else 'valid',
                               depth_multiplier=depth_multiplier,
                               strides=strides,
                               use_bias=False,
                               name='conv_dw_%d' % block_id)(x, params=params)
    x = layers.BatchNormalization(
        axis=channel_axis, name='conv_dw_%d_bn' % block_id)(x, params=params)
    x = layers.ReLU(6., name='conv_dw_%d_relu' % block_id)(x)

    x = layers.Conv2D(pointwise_conv_filters, (1, 1),
                      padding='same',
                      use_bias=False,
                      strides=(1, 1),
                      name='conv_pw_%d' % block_id)(x, params=params)
    x = layers.BatchNormalization(axis=channel_axis,
                                  name='conv_pw_%d_bn' % block_id)(x, params=params)
    return layers.ReLU(6., name='conv_pw_%d_relu' % block_id)(x)


  	display: -webkit-flex;
  	display: flex;
}
@mixin flexwrap() {
	flex-wrap: wrap;
	-webkit-flex-wrap: wrap;
	-moz-flex-wrap: wrap;
}

@font-face {
	font-family: 'icomoon';
	src:url('../fonts/icomoon/icomoon.eot?srf3rx');
	src:url('../fonts/icomoon/icomoon.eot?srf3rx#iefix') format('embedded-opentype'),
		url('../fonts/icomoon/icomoon.ttf?srf3rx') format('truetype'),
		url('../fonts/icomoon/icomoon.woff?srf3rx') format('woff'),
		url('../fonts/icomoon/icomoon.svg?srf3rx#icomoon') format('svg');
	font-weight: normal;
	font-style: normal;
}

@mixin icomoon() {
	font-family: 'icomoon';
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;

	/* Better Font Rendering =========== */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;

}

@mixin gradient-background(){
	background: #499bea;
background: -moz-linear-gradient(-45deg, #499bea 0%, #798eea 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, #499bea), color-stop(100%, #798eea));
background: -webkit-linear-gradient(-45deg, #499bea 0%, #798eea 100%);
background: -o-linear-gradient(-45deg, #499bea 0%, #798eea 100%);
background: -ms-linear-gradient(-45deg, #499bea 0%, #798eea 100%);
background: linear-gradient(135deg, #499bea 0%, #798eea 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#499bea', endColorstr='#798eea', GradientType=1 );
}

// Import
@import 'bootstrap/mixins';
@import 'bootstrap/variables';

/* =======================================================
*
* 	Template Style
*
* ======================================================= */

body {
	font-family: $font-primary;
	font-weight: 300;
	font-size: 16px;
	line-height: 2;
	color: lighten($brand-black,50%);
	background: lighten($brand-black,96%);
}
#page {
	position: relative;
	overflow-x: hidden;
	width: 100%;
	height: 100%;
	@include transition(.5s);
	.offcanvas & {
		overflow: hidden;
		position: absolute;

		&:after {
			@include transition(2s);
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
			z-index: 101;
			background: rgba(0,0,0,.7);
			content: "";
		}
	}
}
a {
	color: $brand-primary;
	@include transition(.5s);
	&:hover, &:active, &:focus {
		color: $brand-primary;
		outline: none;
		text-decoration: none;
	}
}
p {
	margin-bottom: 20px;
}

h1, h2, h3, h4, h5, h6, figure {
	color: $brand-darker;
	font-family: $font-secondary;
	font-weight: 400;
	margin: 0 0 20px 0;
	line-height: 1.3;
}
::-webkit-selection {
  color: $brand-white;
  background: $brand


are of the rest.$B$BWhen you have enough morrowgrain, bring them to me here on Elder Rise.  Please don\'t bother the Arch Druid; he\'ll be very busy with the research, as well as the multitude of concerns he has!",
    ["O"] = "Use an Evergreen Pouch with a Packet of Tharlendis Seeds and two Un\'Goro Soil samples to try and cultivate samples of Morrowgrain.$B$BBring 10 Morrowgrain to Bashana Runetotem in Thunder Bluff.",
    ["T"] = "Morrowgrain Research",
  },
  [3787] = {
    ["D"] = "Excuse me, friend...$B$BA colleague of mine would like to speak with you about the research you are doing in conjunction with the Cenarion Circle.  He is a druid by the name of Quintis Jonespyre, and he resides in Feathermoon Stronghold, Feralas.  He would like to confer with you about morrowgrain... and he very much would like for you to keep our discussion from the ears of the Arch Druid.$B$BIf you\'re interested, speak with him; no doubt, all will be revealed once you do.",
    ["O"] = "Speak with Quintis Jonespyre in Feathermoon Stronghold.",
    ["T"] = "Jonespyre\'s Request",
  },
  [3788] = {
    ["D"] = "Excuse me, friend...$B$BA colleague of mine would like to speak with you about the research you are doing in conjunction with the Cenarion Circle.  He is a druid by the name of Quintis Jonespyre, and he resides here in Feathermoon Stronghold.  He would like to confer with you about morrowgrain... and he very much would like for you to keep our discussion from the ears of the Arch Druid.$B$BIf you\'re interested, speak with him; no doubt, all will be revealed once you do.",
    ["O"] = "Speak with Quintis Jonespyre in Feathermoon Stronghold.",
    ["T"] = "Jonespyre\'s Request",
  },
  [3789] = {
    ["D"] = "실례하겠습니다. 괜찮으시다면 잠시만 시간을 내 주시겠습니까?$B$B다르나서스의 세나리온 의회에서 아주 중요한 조사 작업 때문에 당신처럼 노련한 모험가들을 찾고 있습니다. 자세한 내용은 모르지만 이 연구 조사를 다름 아닌 대드루이드 판드랄 스태그헬름께서 직접 지휘하고 있다는 것만은 말씀드릴 수 있습니다.$B$B혹시 관심이 있으시다면 다르나서스 내에 있는 세나리온 자치령에서 그분과 직접 얘기를 나눠 보십시오.",
    ["O"] = "다르나서스에 있는 대드루이드 판드랄 스태그헬름과 대화해야 합니다.",
    ["T"] = "대드루이드 스태그헬름 돕기",
  },
  [3790] = {
    ["D"] = "실례하겠습니다. 괜찮으시다면 잠시만 시간을 �


cameraValue), "HasCameraValue");
				Assert.AreEqual (0f, cameraValue, "NeutralValue");
			});
		}

		[Test]
		public void CtorTest_Camera ()
		{
			TestRuntime.AssertXcodeVersion (16, 0);

			using var obj = new MERawProcessingFloatParameter ("name", "key", "description", 1.2f, 3.4f, 0.1f, 1.1f, MERawProcessingFloatParameterInitializationOption.CameraValue);
			Assert.Multiple (() => {
				Assert.AreEqual ("name", obj.Name, "Name");
				Assert.AreEqual ("key", obj.Key, "Key");
				Assert.IsNull (obj.LongDescription, "LongDescription");
				Assert.AreEqual (1.2f, obj.InitialValue, "InitialValue");
				Assert.AreEqual (1.2f, obj.CurrentValue, "CurrentValue");
				Assert.AreEqual (3.4f, obj.MaximumValue, "MaximumValue");
				Assert.AreEqual (0.1f, obj.MinimumValue, "MinimumValue");
				Assert.IsFalse (obj.HasNeutralValue (out var neutralValue), "HasNeutralValue");
				Assert.AreEqual (0f, neutralValue, "NeutralValue");
				Assert.IsTrue (obj.HasCameraValue (out var cameraValue), "HasCameraValue");
				Assert.AreEqual (1.1f, cameraValue, "NeutralValue");
			});
		}
	}
}
#endif // HAS_MEDIAEXTENSION


* @throws IllegalArgumentException if name is null
     */
    public HtmlStringBuffer elementEnd(String name) {
        if (name == null) {
            throw new IllegalArgumentException("Null name parameter");
        }
        append("</");
        append(name);
        append(">");

        return this;
    }

    /**
     * Append a HTML element end to the string buffer.
     *

     * For example:
     *

     *    closeTag()  ->  >

     *
     * @return a reference to this <tt>HtmlStringBuffer</tt> object
     */
    public HtmlStringBuffer closeTag() {
        append(">");

        return this;
    }

    /**
     * Append a HTML element end to the string buffer.
     *

     * For example:
     *

     *    elementEnd()  ->  />

     *
     * @return a reference to this <tt>HtmlStringBuffer</tt> object
     */
    public HtmlStringBuffer elementEnd() {
        append("/>");

        return this;
    }

    /**
     * Append a HTML element start to the string buffer.
     *

     * For example:
     *

     *    elementStart("input")  ->  <input

     *
     * @param name the HTML element name to start
     * @return a reference to this <tt>HtmlStringBuffer</tt> object
     */
    public HtmlStringBuffer elementStart(String name) {
        append("<");
        append(name);

        return this;
    }

    /**
     * Return true if the given attribute name is a JavaScript attribute,
     * or false otherwise.
     *
     * @param name the HTML attribute name to test
     * @return true if the HTML attribute is a JavaScript attribute
     */
    public boolean isJavaScriptAttribute(String name) {
        if (name.length() < 6 || name.length() > 11) {
            return false;
        }

        if (!name.startsWith("on")) {
            return false;
        }

        for (String jsAttribute : JS_ATTRIBUTES) {
            if (jsAttribute.equalsIgnoreCase(name)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Return the length of the string buffer.
     *
     * @return the length of the string buffer
     */
    public int length() {
        return count;
    }

    /**
     * @see Object#toString()
     *
     * @return a string representation of the string buffer
     */
    @Override
    public String toString() {
        return new String(characters, 0, count);
    }

    // ------------------------------------------------------ Protected Methods

    /**
     * Ensures that the capacity is at least equal to the specified minimum.
     * If the current capacity is less than the argument, then a new internal
     * array is allocated with greater capacity. The new capacity is the
     * larger of:
     *

     *
The minimumCapacity argument.
     *
Twice the old capacity, plus 2.
     *

     * If the minimumCapacity argument is non-positive, this method
     * takes no action and simply returns.
     *
     * @param minimumCapacity the minimum desired capacity
     */
    protected void expandCapacity(int minimumCapacity) {
        int newCapacity = (characters.length + 1) * 2;

        if (newCapacity < 0) {
            newCapacity = Integer.MAX_VALUE;
        } else if (minimumCapacity > newCapacity) {
            newCapacity = minimumCapacity;
        }

        char newValue[] = new char[newCapacity];
        System.arraycopy(characters, 0, newValue, 0, count);
        characters =


        }

        WeatherView.WEATHER_KIND_CLOUDY -> if (daylight) {
            R.drawable.widget_weather_background_cloudy_day
        } else {
            R.drawable.widget_weather_background_cloudy_night
        }

        WeatherView.WEATHER_KIND_FOG -> if (daylight) {
            R.drawable.widget_weather_background_fog_day
        } else {
            R.drawable.widget_weather_background_fog_night
        }

        WeatherView.WEATHER_KIND_HAIL -> if (daylight) {
            R.drawable.widget_weather_background_hail_day
        } else {
            R.drawable.widget_weather_background_hail_night
        }

        WeatherView.WEATHER_KIND_HAZE -> if (daylight) {
            R.drawable.widget_weather_background_haze_day
        } else {
            R.drawable.widget_weather_background_haze_night
        }

        WeatherView.WEATHER_KIND_RAINY -> if (daylight) {
            R.drawable.widget_weather_background_rain_day
        } else {
            R.drawable.widget_weather_background_rain_night
        }

        WeatherView.WEATHER_KIND_SLEET -> if (daylight) {
            R.drawable.widget_weather_background_sleet_day
        } else {
            R.drawable.widget_weather_background_sleet_night
        }

        WeatherView.WEATHER_KIND_SNOW -> if (daylight) {
            R.drawable.widget_weather_background_snow_day
        } else {
            R.drawable.widget_weather_background_snow_night
        }

        WeatherView.WEATHER_KIND_THUNDER, WeatherView.WEATHER_KIND_THUNDERSTORM -> if (daylight) {
            R.drawable.widget_weather_background_thunder_day
        } else {
            R.drawable.widget_weather_background_thunder_night
        }

        WeatherView.WEATHER_KIND_WIND -> if (daylight) {
            R.drawable.widget_weather_background_wind_day
        } else {
            R.drawable.widget_weather_background_wind_night
        }

        else ->
            R.drawable.widget_weather_background_default
    }
}
package com.knight.kotlin.library_widget.listener

import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener
import kotlin.math.abs

/**
 * @author created by luguian
 * @organize
 * @Date 2024/8/16 10:25
 * @descript:
 */
abstract class AppBarStateChangeListener : OnOffsetChangedListener {
    enum class State {
        EXPANDED,//展开
        COLLAPSED,//折叠
        IDLE //中间
    }

    private var mCurrentState = State.IDLE

    override fun onOffsetChanged(appBarLayout: AppBarLayout, i: Int) {
        if (i == 0) {
            if (mCurrentState != State.EXPANDED) {
                onStateChanged(appBarLayout, State.EXPANDED)
            }
            mCurrentState = State.EXPANDED
        } else if (abs(i.toDouble()) >= appBarLayout.totalScrollRange) {
            if (mCurrentState != State.COLLAPSED) {
                onStateChanged(appBarLayout, State.COLLAPSED)
            }
            mCurrentState = State.COLLAPSED
        } else {
            if (mCurrentState != State.IDLE) {
                onStateChanged(appBarLayout, State.IDLE)
            }
            mCurrentState = State.IDLE
        }
    }

    abstract fun onStateChanged(appBarLayout: AppBarLayout?, state: State?)
}package com.knight.kotlin.library_widget.linkview

import android.util.Log

/**
 * Author:Knight
 * Time:2024/3


             |_|
///  Sass Maps Plus 0.9.2
///  Advanced map and list-map manipulation for all versions of Sass
///  MIT License
///  @author Lu Nelson

/// Global sort direction: either `asc` or `desc`
/// @access public
/// @group map-lists/map-maps
$maps-sort-dir: "asc";

/// get value at nested or 'deep' key, per $keys list
/// @access public
/// @group maps
/// @param {Map} $map - map
/// @param {Arglist} $keys - nested keys
/// @return {*}
@function map-get-nested($map, $keys...) {
  @if length($map) == 0 {
    @return null;
  }
  @each $key in $keys {
    @if type-of($map) != "map" {
      @return $map;
    }
    $map: map-get($map, $key);
  }
  @return $map;
}

/// Sort a list-of-maps or map-of-maps, based on value at key(s) in maps
/// @access public
/// @group map-lists/map-maps
/// @param {Map|List} $maps - Map of maps, or List of maps, to sort
/// @param {Arglist} $keys - Chain of keys to the value that will be sorted for
/// @return {Map|List}
/// @require {function} map-get-nested
@function maps-sort($maps, $keys...) {
  @if length($keys) == 0 {
    @return $maps;
  }

  @if length($maps) > 1 {
    $less: ();
    $equal: ();
    $greater: ();

    $map-of-maps: type-of($maps) == "map";

    @if $map-of-maps {
      $seed-map: nth(nth($maps, ceil(length($maps) / 2)), 2);

      $seed-value: map-get-nested($seed-map, $keys...);

      // TODO: add code to handle case of non-number values (warn and return $maps)

      @each $key, $map in $maps {
        $curr-value: map-get-nested($map, $keys...);

        @if $curr-value == $seed-value {
          $equal: map-merge($equal,  ($key: $map));
        } @else if $curr-value < $seed-value {
          @if $maps-sort-dir == "asc" {
            $less: map-merge($less,  ($key: $map));
          } @else {
            $greater: map-merge($greater,  ($key: $map));
          }
        } @else {
          @if $maps-sort-dir == "asc" {
            $greater: map-merge($greater,  ($key: $map));
          } @else {
            $less: map-merge($less,  ($key: $map));
          }
        }
      }

      $less: maps-sort($less, $keys...);
      $greater: maps-sort($greater, $keys...);

      @return map-merge(map-merge($less, $equal), $greater);
    } @else {
      $seed-map: nth($maps, ceil(length($maps) / 2));

      $seed-value: map-get-nested($seed-map, $keys...);

      @each $map in $maps {
        $curr-value: map-get-nested($map, $keys...);

        @if $curr-value == $seed-value {
          $equal: append($equal, $map);
        } @else if $curr-value < $seed-value {
          @if $maps-sort-dir == "asc" {
            $less: append($less, $map);
          } @else {
            $greater:


", "Y", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
	}
	public void test018() throws Exception {
		this.runNegativeTest(
			new String[] {
				"X.java",
				"import java.lang.annotation.*;\n" +
				"import static java.lang.annotation.ElementType.*;  \n" +
				"@interface Receiver {}\n" +
				"class Document {}\n" +
				"interface I {\n" +
				"	void foo();\n" +
				"}\n" +
				"class X {\n" +
				"	void foo(@Receiver X this) {}\n" +
				"	class Y {\n" +
				"		 Y(@Receiver X X.this, boolean b) { }\n" +
				"	}\n" +
				"}\n",
			},
			"----------\n" +
			"1. ERROR in X.java (at line 9)\n" +
			"	void foo(@Receiver X this) {}\n" +
			"	         ^^^^^^^^^\n" +
			"Annotation types that do not specify explicit target element types cannot be applied here\n" +
			"----------\n" +
			"2. ERROR in X.java (at line 11)\n" +
			"	Y(@Receiver X X.this, boolean b) { }\n" +
			"	  ^^^^^^^^^\n" +
			"Annotation types that do not specify explicit target element types cannot be applied here\n" +
			"----------\n");
	}
	public void test019() throws Exception {
		this.runConformTest(
			new String[] {
				"X.java",
				"import java.lang.annotation.*;\n" +
				"import static java.lang.annotation.ElementType.*; \n" +
				"@Target(TYPE_USE)\n" +
				"@interface Readonly {}\n" +
				"class X<@Readonly T> {\n" +
				"}\n",
		},
		"");
		String expectedOutput =
				"  RuntimeInvisibleTypeAnnotations: \n" +
				"    #21 @Readonly(\n" +
				"      target type = 0x0 CLASS_TYPE_PARAMETER\n" +
				"      type parameter index = 0\n" +
				"    )\n";
		checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
	}
	public void test020() throws Exception {
		this.runNegativeTest(
			new String[] {
				"X.java",
				"import java.util.@NotAllowed Date; // illegal!\n" +
				"import @IllegalSyntax java.util.Date; // illegal syntax\n" +
				"import java.lang.annotation.*;\n" +
				"import static java.lang.annotation.ElementType.*; \n" +
				"@Target(TYPE_USE)\n" +
				"@interface Even {}\n" +
				"@Target(TYPE_USE)\n" +
				"@interface NonEmpty {}\n" +
				"@Target(TYPE_USE)\n" +
				"@interface NotAllowed {}\n" +
				"@Target(TYPE_USE)\n" +
				"@interface IllegalSyntax {}\n" +
				"@Target(TYPE_USE)\n" +
				"@interface Legal {}\n" +
				"class X {\n" +
				"	static int staticField;\n" +
				"	static class StaticNestedClass {}\n" +
				"	void foo() {\n" +
				"		Object o = @Even int.class; // illegal!\n" +
				"		o = int @NonEmpty [].class; // illegal!\n" +
				"		int x = @IllegalSyntax X.staticField;\n" +
				"		StaticNestedClass snc = (@IllegalSyntax X.StaticNestedClass) null;\n" +
				"		X.@Legal StaticNestedClass lsnc = (X.@Legal St


#pragma once

extern USB_OTG_GlobalTypeDef *USBx;

#define USBx_DEVICE     ((USB_OTG_DeviceTypeDef *)((uint32_t)USBx + USB_OTG_DEVICE_BASE))
#define USBx_INEP(i)    ((USB_OTG_INEndpointTypeDef *)((uint32_t)USBx + USB_OTG_IN_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
#define USBx_OUTEP(i)   ((USB_OTG_OUTEndpointTypeDef *)((uint32_t)USBx + USB_OTG_OUT_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
#define USBx_DFIFO(i)   *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_FIFO_BASE + ((i) * USB_OTG_FIFO_SIZE))
#define USBx_PCGCCTL    *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_PCGCCTL_BASE)

#define USBD_FS_TRDT_VALUE 5UL
#define USB_OTG_SPEED_FULL 3UL

void usb_irqhandler(void);
void usb_init(void);


()
    }
    match run_drop(sep.to_ref(), ICont { ok, config, drop }, ()) {
        (Err(e), None) => Err(e),
        (Err(e), Some(())) => Ok((t, IOk { input, state, cutted, err: Some(e) })),
        (Ok((_, ok)), _) => {
            if ok.cutted {
                drop()
            }
            match run_drop(p.to_ref(), ok.to_cont(config, drop), (input, state)) {
                (Err(e), None) => Err(e),
                (Err(e), Some((input, state))) => Ok((t, IOk { input, state, cutted, err: Some(e) })),
                (Ok((o, ok)), _) => run_left_sep(succ(t, o), p, sep, succ, ok.to_cont(config, drop)),
            }
        },
    }
}

/// The parser will be separated by another parser (the result will be discarded) and folded.
/// # Example
/// ```
/// use chasa::char::prelude::*;
/// let d = one_of("0123456789").and_then(|c:char| c.to_string().parse::<usize>().map_err(message));
/// let d = d.to_ref();
/// assert_eq!(d.sep_fold(0, char(','),|a,b| a+b).parse_ok("1,2,3,4,5"), Some(15));
/// assert_eq!(d.sep_fold(0, char(','),|a,b| a+b).parse_ok(""), Some(0));
/// assert_eq!(d.sep_fold(0, char(','),|a,b| a+b).and(char(',').right(d)).parse_ok("1,2,3,4,5,6"), None);
/// assert_eq!(d.sep_fold(0, char(','),|a,b| a+b).and(char(',')).parse_ok("1,2,3,4,"), Some((10, ',')));
/// ```
pub struct SepFold<T, P1, P2, F, O1, O2> {
    pub(crate) init: T,
    pub(crate) p: P1,
    pub(crate) sep: P2,
    pub(crate) succ: F,
    pub(crate) _marker: PhantomData<fn() -> (O1, O2)>,
}
impl<T: Clone, P1: Clone, P2: Clone, F: Clone, O1, O2> Clone for SepFold<T, P1, P2, F, O1, O2> {
    #[inline]
    fn clone(&self) -> Self {
        Self {
            init: self.init.clone(),
            p: self.p.clone(),
            sep: self.sep.clone(),
            succ: self.succ.clone(),
            _marker: PhantomData,
        }
    }
}
impl<T: Copy, P1: Copy, P2: Copy, F: Copy, O1, O2> Copy for SepFold<T, P1, P2, F, O1, O2> {}
#[inline]
pub fn sep_fold<T, P1, P2, F, O1, O2>(init: T, p: P1, sep: P2, succ: F) -> SepFold<T, P1, P2, F, O1, O2> {
    SepFold { init, p, sep, succ, _marker: PhantomData }
}
impl<
        I: Input,
        O1,
        O2,
        C,
        S: Clone,
        M: Cb,
        T,
        P1: Parser<I, O1, C, S, M>,
        P2: Parser<I, O


<String, TACSymbol.Var>,
        fv2: Pair<String, TACSymbol.Var>,
        storageBasis: StorageBasis.Ghost
    ): CommandWithRequiredDecls<TACCmd.Simple> {
        check(eq) {
            "Attempted to use skolemization version for inequality of $fv1 and $fv2"
        }
        val v1 = fv1.second
        val v2 = fv2.second
        val vTag = v1.tag
        check(vTag is Tag.GhostMap && v1.tag == v2.tag) {
            "Unexpected shape of tags for ghost map comparison $v1 with ${v1.tag} vs $v2 with ${v2.tag}"
        }
        return generateMapComparison(
            p = vTag.paramSorts,
            m1 = v1,
            m2 = v2,
            outputVar = output,
            elemTag = vTag.resultSort,
            gen = { params, base, lhs ->
                TACCmd.Simple.AssigningCmd.AssignExpCmd(
                    lhs = lhs,
                    rhs = TACExpr.Select.buildMultiDimSelect(
                        base = base.asSym(),
                        params.map {
                            it.asSym()
                        }
                    )
                )
            }
        ) { params: List<TACSymbol.Var>, e1: TACSymbol.Var, e2: TACSymbol.Var ->
            check(params.size == storageBasis.params.size) {
                "Mismatched tag sizes $params vs ${storageBasis.params}"
            }
            CommandWithRequiredDecls(
                SnippetCmd.CVLSnippetCmd.GhostWitnessComparison(
                    parameters = params,
                    resultSymbol = output,
                    p1 = fv1.first to e1,
                    p2 = fv2.first to e2,
                    basis = storageBasis
                ).toAnnotation()
            )
        }
    }

    /**
     * Generates a word map comparison.
     */
    override fun generateWordMapComparison(
        eq: Boolean,
        output: TACSymbol.Var,
        fv1: Pair<String, TACSymbol.Var>,
        fv2: Pair<String, TACSymbol.Var>,
        storageBasis: StorageBasis.VMStorageBasis
    ): CommandWithRequiredDecls<TACCmd.Simple> {
        val v1 = fv1.second
        val v2 = fv2.second
        check(eq) {
            "Attempted to use skolemization version on inequality check on $fv1 and $fv2"
        }
        check(v1.tag == Tag.WordMap && v2.tag == Tag.WordMap)
        return generateMapComparison(
            p = listOf(Tag.Bit256),
            m1 = fv1.second,
            m2 = fv2.second,
            elemTag = Tag.Bit256,
            outputVar = output,
            gen = { params, base, lhs ->
                check(params.size == 1) {
                    "Unexpected arity (!= 1) of parameters for $fv1 vs $fv2: $params"
                }
                TACCmd.Simple.AssigningCmd.WordLoad(
                    lhs = lhs,
                    base = base,
                    loc = params.first(),
                    meta = MetaMap(TACMeta.CVL_STORAGE_COMPARISON)
                )
            }
        ) { params: List<TACSymbol.Var>, e1: TACSymbol.Var, e2: TACSymbol.Var ->
            /**
             * This is a little more complicated than the ghost map case. Here, we want to capture
             * the skey version of the witness (for parsing out counter example paths). However, at this
             * point in the pipeline, skeys do not exist, and the `to_skey` function is not available to use.
             * If we just capture the witness value directly, then we'll get:
             *
             * ```
             * witness = *
             * e1 = m1[to_skey(witness)]
             * e2 = m2[to_skey(witness)]
             * ```
             *
             * With the path to get the ske


 properly prefixed with BOOST_DATE_TIME_DECL.
 * The corresponding .cpp file must have BOOST_DATE_TIME_SOURCE
 * defined before including its header. For examples see:
 * greg_month.hpp & greg_month.cpp
 *
 */

// we need to import/export our code only if the user has specifically
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
// libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK
// if they want just this one to be dynamically liked:
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
    // export if this is our own source, otherwise import:
#   ifdef BOOST_DATE_TIME_SOURCE
#     define BOOST_DATE_TIME_DECL BOOST_SYMBOL_EXPORT
#   else
#     define BOOST_DATE_TIME_DECL BOOST_SYMBOL_IMPORT
#   endif  // BOOST_DATE_TIME_SOURCE
#endif  // DYN_LINK
//
// if BOOST_WHATEVER_DECL isn't defined yet define it now:
#ifndef BOOST_DATE_TIME_DECL
#  define BOOST_DATE_TIME_DECL
#endif

//
// Automatically link to the correct build variant where possible.
//
#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_DATE_TIME_NO_LIB) && !defined(BOOST_DATE_TIME_SOURCE)
//
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME boost_date_time
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
#  define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif  // auto-linking disabled

#if defined(BOOST_HAS_THREADS)
#  if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) ||  defined(__BORLANDC__)
     //no reentrant posix functions (eg: localtime_r)
#  elif (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT)))
#   define BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS
#  endif
#endif

#endif
#ifndef DATE_TIME_TIME_ZONE_NAMES_HPP__
#define DATE_TIME_TIME_ZONE_NAMES_HPP__

/* Copyright (c) 2002-2003,2005 CrystalClear Software, Inc.
 * Use, modification and distribution is subject to the
 * Boost Software License, Version 1.0. (See accompanying
 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 * Author: Jeff Garland
 * $Date$
 */

#include <string>

namespace boost {
namespace date_time {

  template<class CharT>
  struct default_zone_names {
    public:
      typedef CharT char_type;
      static const char_type standard_name[9];
      static const char_type standard_abbrev[11];
      static const char_type non_dst_identifier[7];
  };
  template <class CharT>
  const typename default_zone_names<CharT>::char_type
  default_zone_names<CharT>::standard_name[9] =
    {'s','t','d','_','n','a','m','e'};

  template <class CharT>
  const typename default_zone_names<CharT>::char_type
  default_zone_names<CharT>::standard_abbrev[11] =
    {'s','t','d','_','a','b','b','r','e','v'};

  template <class CharT>
  const typename default_zone_names<CharT>::char_type
  default_zone_names<CharT>::non_dst_identifier[7] =
    {'n','o','-','d','s','t'};

  //! Base type that


s = time.hour + (mins * 60.0) / 3600.0;

	effect = obs.obs_get_base_effect(obs.OBS_EFFECT_DEFAULT)

	obs.gs_blend_state_push()
	obs.gs_reset_blend_state()

	while obs.gs_effect_loop(effect, "Draw") do
		obs.obs_source_draw(data.image.texture, 0, 0, data.image.cx, data.image.cy, false);
	end

	obs.gs_matrix_push()
	obs.gs_matrix_translate3f(250, 250, 0)
	obs.gs_matrix_rotaa4f(0.0, 0.0, 1.0, 2 * math.pi / 60 * mins);
	obs.gs_matrix_translate3f(-250, -250, 0)

	while obs.gs_effect_loop(effect, "Draw") do
		obs.obs_source_draw(data.minute_image.texture, 0, 0, data.image.cx, data.image.cy, false);
	end

	obs.gs_matrix_pop()

	obs.gs_matrix_push()
	obs.gs_matrix_translate3f(250, 250, 0)
	obs.gs_matrix_rotaa4f(0.0, 0.0, 1.0, 2.0 * math.pi / 12 * hours);
	obs.gs_matrix_translate3f(-250, -250, 0)

	while obs.gs_effect_loop(effect, "Draw") do
		obs.obs_source_draw(data.hour_image.texture, 0, 0, data.image.cx, data.image.cy, false);
	end

	obs.gs_matrix_pop()

	obs.gs_matrix_push()
	obs.gs_matrix_translate3f(250, 250, 0)
	obs.gs_matrix_rotaa4f(0.0, 0.0, 1.0, 2 * math.pi / 60 * seconds);
	obs.gs_matrix_translate3f(-250, -250, 0)

	while obs.gs_effect_loop(effect, "Draw") do
		obs.obs_source_draw(data.second_image.texture, 0, 0, data.image.cx, data.image.cy, false);
	end

	obs.gs_matrix_pop()

	obs.gs_blend_state_pop()
end

source_def.get_width = function(data)
	return 500
end

source_def.get_height = function(data)
	return 500
end

function script_description()
	return "Adds a \"Lua Clock\" source which draws an animated analog clock."
end

obs.obs_register_source(source_def)


batch verifier service

use std::{
    future::Future,
    mem,
    pin::Pin,
    task::{Context, Poll},
};

use rand::thread_rng;
use redjubjub::{batch, *};
use tokio::sync::broadcast::{channel, RecvError, Sender};
use tower::Service;
use tower_batch::BatchControl;

/// RedJubjub signature verifier service
pub struct Verifier {
    batch: batch::Verifier,
    // This uses a "broadcast" channel, which is an mpmc channel. Tokio also
    // provides a spmc channel, "watch", but it only keeps the latest value, so
    // using it would require thinking through whether it was possible for
    // results from one batch to be mixed with another.
    tx: Sender<Result<(), Error>>,
}

#[allow(clippy::new_without_default)]
impl Verifier {
    /// Create a new RedJubjubVerifier instance
    pub fn new() -> Self {
        let batch = batch::Verifier::default();
        // XXX(hdevalence) what's a reasonable choice here?
        let (tx, _) = channel(10);
        Self { tx, batch }
    }
}

/// Type alias to clarify that this batch::Item is a RedJubjubItem
pub type Item = batch::Item;

impl Service<BatchControl<Item>> for Verifier {
    type Response = ();
    type Error = Error;
    type Future = Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'static>>;

    fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
        Poll::Ready(Ok(()))
    }

    fn call(&mut self, req: BatchControl<Item>) -> Self::Future {
        match req {
            BatchControl::Item(item) => {
                tracing::trace!("got item");
                self.batch.queue(item);
                let mut rx = self.tx.subscribe();
                Box::pin(async move {
                    match rx.recv().await {
                        Ok(result) => result,
                        Err(RecvError::Lagged(_)) => {
                            tracing::warn!(
                                "missed channel updates for the correct signature batch!"
                            );
                            Err(Error::InvalidSignature)
                        }
                        Err(RecvError::Closed) => panic!("verifier was dropped without flushing"),
                    }
                })
            }

            BatchControl::Flush => {
                tracing::trace!("got flush command");
                let batch = mem::take(&mut self.batch);
                let _ = self.tx.send(batch.verify(thread_rng()));
                Box::pin(async { Ok(()) })
            }
        }
    }
}

impl Drop for Verifier {
    fn drop(&mut self) {
        // We need to flush the current batch in case there are still any pending futures.
        let batch = mem::take(&mut self.batch);
        let _ = self.tx.send(batch.verify(thread_rng()));
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    use std::time::Duration;

    use color_eyre::eyre::Result;
    use futures::stream::{FuturesUnordered, StreamExt};
    use tower::ServiceExt;
    use tower_batch::Batch;

    async fn sign_and_verify<V>(mut verifier: V, n: usize) -> Result<(), V::Error>
    where
        V: Service<Item, Response = ()>,
    {
        let rng = thread_rng();
        let mut results = Futures


= 'Creature\\NorthrendNightbane\\NorthrendNightBane.mdx'
    ModelA[62986] = 'Creature\\NorthrendPenguin\\NorthrendPenguin.mdx'
    ModelA[62985] = 'Creature\\NorthrendStoneGiant\\NorthrendStoneGiant.mdx'
    ModelA[62984] = 'Creature\\NorthrendWorgen\\NorthrendWorgen.mdx'
    ModelA[62983] = 'Creature\\ProtoDragon\\ProtoDragon.mdx'
    ModelA[62982] = 'Creature\\RevenantAir\\RevenantAir.mdx'
    ModelA[62981] = 'Creature\\RevenantEarth\\RevenantEarth.mdx'
    ModelA[62980] = 'Creature\\RevenantFire\\RevenantFire.mdx'
    ModelA[62979] = 'Creature\\RevenantWater\\RevenantWater.mdx'
    ModelA[62978] = 'Creature\\SeaVrykulMale\\SeaVrykulMale.mdx'
    ModelA[62977] = 'Creature\\SeaVrykulMale\\SeaVrykulMale_A.mdx'
    ModelA[62976] = 'Creature\\SeaVrykul\\SeaVrykul.mdx'
    ModelA[62975] = 'Creature\\Snobold\\Snobold.mdx'
    ModelA[62974] = 'Creature\\SnowFlakeCreature\\SnowFlakeCreature.mdx'
    ModelA[62973] = 'Creature\\StoneTreeLog\\StoneTreeLog02_Mount.mdx'
    ModelA[62972] = 'Creature\\StoneTreeLog\\StoneTreeLog03_Mount.mdx'
    ModelA[62971] = 'Creature\\SuperZombie\\superzombie.mdx'
    ModelA[62970] = 'Creature\\Tauren_MountedCanoe\\Tauren_MountedCanoe.mdx'
    ModelA[62969] = 'Creature\\TuskarrMaleFisherman\\TuskarrMaleFisherman.mdx'
    ModelA[62968] = 'Creature\\UndeadIceTroll\\UndeadIceTroll.mdx'
    ModelA[62967] = 'Creature\\ValkierDark\\ValkierDark.mdx'
    ModelA[62966] = 'Creature\\Valkier\\Valkier.mdx'
    ModelA[62965] = 'Creature\\VrykulBoat\\Transport_Vrykul_Medium.mdx'
    ModelA[62964] = 'Creature\\VrykulBoat\\Transport_Vrykul_MediumLight.mdx'
    ModelA[62963] = 'Creature\\VrykulFemale\\FemaleVrykulBoss.mdx'
    ModelA[62962] = 'Creature\\VrykulFemale\\FrostVrykulFemaleCaster.mdx'
    ModelA[62961] = 'Creature\\VrykulFemale\\FrostVrykulFemaleDruid.mdx'
    ModelA[62960] = 'Creature\\VrykulFemale\\FrostVrykulFemaleHunter.mdx'
    ModelA[62959] = 'Creature\\VrykulFemale\\FrostVrykulFemaleWarrior.mdx'
    ModelA[62958] = 'Creature\\VrykulFemale\\VrykulFemale.mdx'
    ModelA[62957] = 'Creature\\VrykulFemale\\VrykulFemaleCaster.mdx'
    ModelA[62956] = 'Creature\\VrykulFemale\\VrykulFemaleDruid.mdx'
    ModelA[62955] = 'Creature\\VrykulFemale\\VrykulFemaleHunter.mdx'
    ModelA[62954] = 'Creature\\VrykulFemale\\VrykulFemaleWarrior.mdx'
    ModelA[6


O)
        return
    end

    local load_lcov = function()
        if config.opts.load_coverage_cb ~= nil then
            vim.schedule(function()
                config.opts.load_coverage_cb("lcov")
            end)
        end

        local result = util.lcov_to_table(p)

        -- Since we don't know the actual language, use the default common
        -- summary and sign_list.
        report.cache(result, "common")
        local sign_list = common.sign_list(result)
        if place or signs.is_enabled() then
            signs.place(sign_list)
        else
            signs.cache(sign_list)
        end
    end

    watch.start(file, load_lcov)

    -- When signs were enabled, calling load_lcov would disable them.
    -- That didn't seem like good UX to me, so I disabled this.
    -- signs.clear()
    load_lcov()
end

return M


     struct cork_dllist_item  *next = curr->next;
        enum cork_hash_table_map_result  result;

        DEBUG("    Apply function to entry %p", entry);
        result = map(user_data, &entry->public);

        if (result == CORK_HASH_TABLE_MAP_ABORT) {
            return;
        } else if (result == CORK_HASH_TABLE_MAP_DELETE) {
            DEBUG("      Delete requested");
            cork_dllist_remove(curr);
            table->entry_count--;
            cork_hash_table_free_entry(table, entry);
        }

        curr = next;
    }
}

void
cork_hash_table_iterator_init(struct cork_hash_table *table,
                              struct cork_hash_table_iterator *iterator)
{
    DEBUG("Iterate through hash table");
    iterator->table = table;
    iterator->priv = cork_dllist_start(&table->insertion_order);
}

struct cork_hash_table_entry *
cork_hash_table_iterator_next(struct cork_hash_table_iterator *iterator)
{
    struct cork_hash_table  *table = iterator->table;
    struct cork_dllist_item  *curr = iterator->priv;
    struct cork_hash_table_entry_priv  *entry;

    if (cork_dllist_is_end(&table->insertion_order, curr)) {
        return NULL;
    }

    entry = cork_container_of
        (curr, struct cork_hash_table_entry_priv, insertion_order);
    DEBUG("    Return entry %p", entry);
    iterator->priv = curr->next;
    return &entry->public;
}

/*-----------------------------------------------------------------------
 * Built-in key types
 */

static cork_hash
string_hash(void *user_data, const void *vk)
{
    const char  *k = vk;
    size_t  len = strlen(k);
    return cork_hash_buffer(0, k, len);
}

static bool
string_equals(void *user_data, const void *vk1, const void *vk2)
{
    const char  *k1 = vk1;
    const char  *k2 = vk2;
    return strcmp(k1, k2) == 0;
}

struct cork_hash_table *
cork_string_hash_table_new(size_t initial_size, unsigned int flags)
{
    struct cork_hash_table  *table = cork_hash_table_new(initial_size, flags);
    cork_hash_table_set_hash(table, string_hash);
    cork_hash_table_set_equals(table, string_equals);
    return table;
}

struct cork_hash_table *
cork_pointer_hash_table_new(size_t initial_size, unsigned int flags)
{
    return cork_hash_table_new(initial_size, flags);
}


Offset until shrinkDataOffset + shrinkDataCount) {
            val tab = tabs[g.shrinkWidthBuffer[tabN].index]
            var shrinkedWidth = floor(g.shrinkWidthBuffer[tabN].width)
            if (shrinkedWidth < 0f)
                continue

            shrinkedWidth = 1f max shrinkedWidth
            val sectionN = tabItemGetSectionIdx(tab)
            sections[sectionN].width -= tab.width - shrinkedWidth
            tab.width = shrinkedWidth
        }
    }

    // Layout all active tabs
    var sectionTabIndex = 0
    var tabOffset = 0f
    widthAllTabs = 0f
    for (sectionN in 0..2) {
        val section = sections[sectionN]
        if (sectionN == 2)
            tabOffset = min(max(0f, barRect.width - section.width), tabOffset)

        for (tabN in 0 until section.tabCount) {
            val tab = tabs[sectionTabIndex + tabN]
            tab.offset = tabOffset
            tab.nameOffset = -1
            tabOffset += tab.width + if (tabN < section.tabCount - 1) g.style.itemInnerSpacing.x else 0f
        }
        widthAllTabs += (section.width + section.spacing) max 0f
        tabOffset += section.spacing
        sectionTabIndex += section.tabCount
    }

    // Clear name buffers
    tabsNames.clear()

    // If we have lost the selected tab, select the next most recently active one
    if (!foundSelectedTabID) selectedTabId = 0
    if (selectedTabId == 0 && nextSelectedTabId == 0)
        mostRecentlySelectedTab?.let {
            selectedTabId = it.id
            scrollToTabID = selectedTabId
        }

    // Lock in visible tab
    visibleTabId = selectedTabId
    visibleTabWasSubmitted = false

    // Apply request requests
    if (scrollToTabID != 0)
        scrollToTab(scrollToTabID, sections)
    else if (flags has TabBarFlag.FittingPolicyScroll && isMouseHoveringRect(barRect.min, barRect.max, true) && g.currentWindow!!.isContentHoverable) {
        val wheel = if (g.io.mouseWheelRequestAxisSwap) g.io.mouseWheel else g.io.mouseWheelH
        val wheelKey = if (g.io.mouseWheelRequestAxisSwap) Key.MouseWheelY else Key.MouseWheelX
        if (wheelKey.testOwner(id) && wheel != 0f) {
            val scrollStep = wheel * calcScrollableWidth(sections) / 3f
            scrollingTargetDistToVisibility = 0f
            scrollingTarget = scrollClamp(scrollingTarget - scrollStep)
        }
        wheelKey.setOwner(id)
    }

    // Update scrolling
    scrollingAnim = scrollClamp(scrollingAnim)
    scrollingTarget = scrollClamp(scrollingTarget)
    if (scrollingAnim != scrollingTarget) { // Scrolling speed adjust itself so we can always reach our target in 1/3 seconds.
        // Teleport if we are aiming far off the visible line
        scrollingSpeed = scrollingSpeed max (70f * g.fontSize)
        scrollingSpeed = scrollingSpeed max (abs(scrollingTarget - scrollingAnim) / 0.3f)
        val teleport = prevFrameVisible + 1 < g.frameCount || scrollingTargetDistToVisibility > 10f * g.fontSize
        scrollingAnim = if (teleport) scrollingTarget else linearSweep(
                scrollingAnim,
                scrollingTarget,
                ImGui.io.deltaTime * scrollingSpeed
        )
    } else scrollingSpeed = 0f

    scrollingRectMinX = barRect.min.x + sections[0].width + sections[0].spacing
    scrollingRectMaxX = barRect.max.x - sections[2].width - sections[1].spacing

    // Actual layout in host window (we don't do it in BeginTabBar() so as not to waste an extra frame)
    val window = g.currentWindow!!
    window.dc.cursorPos put barRect.min
    ImGui.itemSize(Vec2(widthAllTabs, barRect.height), framePadding.y)
    window.dc.idealMaxPos.x = window


document,
            options
        ),
        VoiceOperationCode.Heartbeat => DeserializePayload<IVoiceHeartbeat>
        (
            VoiceOperationCode.Heartbeat,
            document,
            options
        ),
        VoiceOperationCode.Speaking => DeserializePayload<IVoiceSpeakingCommand>
        (
            VoiceOperationCode.Speaking,
            document,
            options
        ),
        VoiceOperationCode.Resume => DeserializePayload<IVoiceResume>
        (
            VoiceOperationCode.Resume,
            document,
            options
        ),

        // Events
        VoiceOperationCode.Ready => DeserializePayload<IVoiceReady>
        (
            VoiceOperationCode.Ready,
            document,
            options
        ),
        VoiceOperationCode.SessionDescription => DeserializePayload<IVoiceSessionDescription>
        (


 0 0 0-.708l-2.585-2.585a.5.5 0 0 0-.708 0L4 14.707z"/><path d="M13.146 4.854l4 4 .708-.708-4-4zm-9 9l4 4 .708-.708-4-4z"/><path d="M15.146 6.146l-9 9 .708.708 9-9z"/></g></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M13.746 7h-1.258l-.5-1.301h-2.289l-.473 1.301h-1.227l2.23-5.727h1.223l2.293 5.727zm-2.129-2.266l-.789-2.125-.773 2.125h1.563z"/><path d="M26.246 4.895l1.121.355c-.172.625-.458 1.089-.857 1.393-.4.303-.907.455-1.521.455-.76 0-1.385-.26-1.875-.779-.49-.52-.734-1.23-.734-2.131 0-.953.246-1.693.738-2.221.492-.527 1.139-.791 1.941-.791.701 0 1.27.207 1.707.621.26.245.456.596.586 1.055l-1.145.273c-.068-.297-.209-.531-.424-.703-.215-


name": "foo/bar/boo-1.0.0.jar",
                    "digest": {
                        "sha256": "d2238e45bb212fbe4a2e8e7dc160ffa123bacc5396899a039e973d2930eb4e41",
                    },
                },
                {
                    "name": "https://witness.dev/attestations/gitlab/v0.1/projecturl:https://gitlab.com/boo/foo",
                    "digest": {
                        "sha256": "24521ae8555394253bdcab117183cc4f96cb5b1a23fee0f81d8cb7221595b536",
                    },
                },
            ],
            id="Any subject that is not a Witness Product attestator file type will cause an exception.",
        )
    ],
)
def test_non_product_witness_subject(
    artifact_assets: list[JFrogMavenAsset],
    non_product_subjects: list[InTotoV01Subject],
) -> None:
    """A subject that is not a file attested by the Witness product attestator should raise an exception."""
    with pytest.raises(WitnessProvenanceException):
        verify_artifact_assets(
            artifact_assets=artifact_assets,
            subjects=non_product_subjects,
        )


checkout .jtc-number{line-height:20px;font:12px/150% Arial,Verdana,"宋体";color:#666}.tbar-checkout .jtc-sum{line-height:20px;font:12px/150% Arial,Verdana,"宋体";color:#666}.tbar-checkout .jtc-sum strong{font-family:verdana;color:#C81623}.tbar-checkout .jtc-btn{position:absolute;right:5px;top:7px;width:110px;height:35px;font:16px/35px "微软雅黑";text-align:center;background:#C81623 none repeat scroll 0 0;color:#FFF}.tbar-cart-list{width:100%;margin:0;padding:0;font:12px/150% Arial,Verdana,"宋体";color:#666}.tbar-cart-item{padding:0 5px;margin-bottom:10px;background:#FFF none repeat scroll 0 0}.jtc-item-promo{padding:12px 0 12px 57px;border-bottom:1px dashed #E1E1E1}.jtc-item-promo .promo-tag{position:relative;float:left;width:40px;height:20px;margin-top:-1px;margin-left:-57px;margin-right:17px;text-align:center;font:12px/20px "宋体";color:#FFF;background-color:#F58813}.jtc-item-promo .promo-text{height:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:12px/18px verdana}.jtc-item-goods{padding:10px 0;position:relative;overflow:hidden}.jtc-item-goods .p-img{float:left;width:50px;height:50px;border:1px solid #DDD;padding:0;margin-right:5px}.jtc-item-goods .p-img img{width:50px;height:50px}img{border:0 none;vertical-align:middle}.jtc-item-goods .p-name{height:32px;line-height:16px;margin-bottom:4px;overflow:hidden}.jtc-item-goods .p-name a{color:#333}.jtc-item-goods .p-price{height:16px;padding-right:65px;overflow:hidden;font:12px/16px verdana;color:#666}.jtc-item-goods .p-price strong{color:#C81623;font-weight:400}.jtc-item-goods .p-del{position:absolute;right:10px;top:46px;width:35px;height:16px;line-height:16px;color:#005AA0;text-align:right;display:none}.tbar-panel-history div{padding:0}.jt-history-wrap{width:235px;margin:0 auto}.tbar-panel-history ul{overflow:hidden;margin-right:-15px;margin-top:0;list-style:outside none none;padding:0}.tbar-panel-history .tbar-panel-header i{width:20px;height:17px;margin-top:11px;background-position:0 -100px}.tbar-panel-follow .tbar-panel-header i{width:20px;height:17px;margin-top:11px;background-position:0 -50px}.tbar-panel-history .jth-item{float:left;position:relative;width:100px;height:120px;margin-right:15px;background:#FFF none repeat scroll 0 0;margin-bottom:15px;padding:5px}.tbar-panel-history .jth-item .img-wrap{display:block;width:100px;height:100px;text-align:center;margin-bottom:5px}.tbar-panel-history .jth-item .add-cart-button{height:20px;line-height:20px;overflow:hidden;text-align:center;text-decoration:none;display:none;position:absolute;width:100px;bottom:25px;left:5px;


        }
        clearStatus()
    }

    fun clearStatus() {
        livingTime = 0f
        curSendingLength = 0f
        totalSendingDistance = 0f
        ClientOnly {
            lastRailTrail.forEach {
                it.curLength = 0f
                it.totalLength = 0f
            }
            for (i in linkingTime.indices) {
                linkingTime[i] = 0f
            }
        }
    }
    /**
     * Check whether the [other] is in this link bound
     * @return true if this can link to it.
     * Note: It doesn't guarantee [other] can link this.
     */
    fun isInLinkBound(side: Side, other: INetworkNode): Boolean {
        this.building.hitbox(rect)
        return rect.raycastInThis(
            tempVec.set(other.building),
            tempVec2.set(tempVec).add(
                coordinates[side].x * this.linkRange,
                coordinates[side].y * this.linkRange
            ),
        ) != null
    }

    fun isSideFull(side: Side) =
        links[side] != -1
    @ClientOnly
    val expendSelectingLineTime: Float
    val linkRange: WorldXY
    val tileLinkRange: TileXY
        get() = (linkRange / Vars.tilesize).toInt()
    /**
     * It will merge [target] into self's network.
     * It will clear the old sides of each other
     * @param side relative to self's side
     */
    fun link(side: Side, target: INetworkNode) {
        // This is necessary, otherwise, you will see two nodes linking to a node on one side.
        clearSide(side)
        target.clearSide(side.reflect)

        this.links[side] = target
        target.links[side.reflect] = this
        DataNetwork.mergeToLagerNetwork(this, target)
    }
    /**
     * It takes the side into account.
     * @param side relative to self's side
     */
    fun canLink(side: Side, target: INetworkNode): Boolean {
        if (target.building.dst(building) > linkRange) return false
        val thisOld = this.links[side]
        val targetOld = target.links[side.reflect]
        if (thisOld != -1 && targetOld != -1) return false
        return true
    }
    /**
     * Clear this side and reflow the network.
     * If the side already held a node, reset its [INetworkNode.links] and create a new network for it.
     * it doesn't consider the enabled side
     */
    fun clearSide(side: Side) {
        val old = links[side]
        if (old == -1) return
        links[side] = -1
        lastRailTrail[side].let {
            it.curLength = 0f
            it.totalLength = 0f
        }
        old.castBuild<INetworkNode>()?.let {
            // If this is a node existed on this side, separate the network
            it.links[side.reflect] = -1
            if (it.network == this.network) {
                val newNetwork = DataNetwork()
                val oldNetwork = it.network
                // MUSTN'T: it.network = newNetwork
                oldNetwork.remove()
                newNetwork.reflow(it)
            }
        }
        this.network.reflow(this)
    }

    companion object {
        private val tempList = ArrayList<INetworkNode>()
        private val tempVec = Vec2()
        private val tempVec2 = Vec2()
        private val rect = Rect()
    }
}

class RailTrail(
    /** Center X or Y  */
    var center: Float = 0f,
    /** current length  */
    var curLength: Float = 0f,
    var totalLength: Float = 0f,
)
/**
 * Only iterate the enabled sides
 */
inline fun INetworkNode


 @author Praneet Tiwari
 */
//FIXME: refactor

public class NullParameter extends Parameter {

    public NullParameter() {
        super(0, new Impl(), new NoConstraint());
    }

    //
    // protected inner classes
    //

    static protected class Impl implements Parameter.Impl {

        @Override
        public /* @Real */ double value(final Array params, final /* @Time */ double t) {
            return 0.0;
        }
    }

}
/*
 Copyright (C) 2009 Ueli Hofstetter

 This source code is release under the BSD License.

 This file is part of JQuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://jquantlib.org/

 JQuantLib is free software: you can redistribute it and/or modify it
 under the terms of the JQuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <jquant-devel@lists.sourceforge.net>. The license is also available online at
 <http://www.jquantlib.org/index.php/LICENSE.TXT>.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.

 JQuantLib is based on QuantLib. http://quantlib.org/
 When applicable, the original copyright notice follows this notice.
 */

package org.jquantlib.processes;

import org.jquantlib.QL;
import org.jquantlib.math.Ops;
import org.jquantlib.math.integrals.GaussKronrodAdaptive;
import org.jquantlib.math.matrixutilities.Array;
import org.jquantlib.math.matrixutilities.Matrix;

public abstract class LfmCovarianceParameterization {
    protected int size_;
    private final int factors_;

    public LfmCovarianceParameterization(final int size, final int factors) {
        if (System.getProperty("EXPERIMENTAL") == null)
            throw new UnsupportedOperationException("Work in progress");

        this.size_ = size;
        this.factors_ = factors;
    }

    public int size() {
        return size_;
    }

    public int factors() {
        return factors_;
    }

    public abstract Matrix diffusion(/* @Time */double t, final Array x);

    public Matrix diffusion(/* @Time */final double t) {
        return diffusion(t, new Array(0)); //ZH:QL097 using Null<Array>
    }

    public Matrix covariance(/* @Time */final double t, final Array x) {
        final Matrix sigma = this.diffusion(t, x);
        return sigma.mul(sigma.transpose());
    }

    public Matrix covariance(/* @Time */final double t) {
        return diffusion(t, new Array(0)); //ZH:QL097 using Null<Array> which is new Array(), see Null.hpp
    }

    public Matrix integratedCovariance(/* @Time */final double t, final Array x) {
        // this implementation is not intended for production.
        // because it is too slow and too inefficient.
        // This method is useful for testing and R&D.
        // Please overload the method within derived classes.
        QL.require(!x.empty() , "can not handle given x here"); // TODO: message

        final Matrix tmp = new Matrix(size_, size_);
        for (int i = 0; i < size_; ++i) {
            for (int j = 0; j <= i; ++j) {
                final Var_Helper helper = new Var_Helper(this, i, j);
                final GaussKronrodAdaptive integrator = new GaussKronrodAdaptive(1e-10, 10000);
                for(int k = 0; k<64; ++k) {


行相应的修改。

### 3. 创建包入口文件

为了能够在其他项目中使用我们的库，我们需要创建一个入口文件来导出我们的 TSConfig。

在项目根目录下创建一个名为 `index.ts` 的文件，并添加以下代码：

```typescript
import * as tsconfig from './tsconfig.json';

export default tsconfig;
```

在上述代码中，我们将 `tsconfig.json` 导入为一个模块，并使用 `export default` 将其导出。

### 4. 构建和发布

现在我们可以使用 TypeScript 编译器将我们的代码构建为 JavaScript，以便在其他项目中使用。

首先，确保你已经在项目中安装了 TypeScript：

```bash
$ npm install typescript --save-dev
```

然后，在 `package.json` 中添加构建脚本：

```json
{
  "scripts": {
    "build": "tsc"
  }
}
```

最后，运行构建命令进行构建：

```bash
$ npm run build
```

构建完成后，我们的库文件

将位于 `dist` 目录下。

### 5. 发布到 NPM

要将我们的 TSConfig 封装为一个库，并使其可供其他项目使用，我们可以将其发布到 NPM。

首先，创建一个 NPM 账号，并登录到 NPM：

```bash
$ npm login
```

然后，在项目根目录下运行以下命令发布库：

```bash
$ npm publish
```

发布成功后，我们的 TSConfig 库就可以在其他项目中使用了。

### 6. 在其他项目中使用

在其他项目中使用我们的 TSConfig 库非常简单。首先，在目标项目中安装我们的库：

```bash
$ npm install my-tsconfig-lib --save-dev
```

然后，在目标项目的 `tsconfig.json` 文件中使用我们的 TSConfig：

```json
{
  "extends": "my-tsconfig-lib"
}
```

通过 `extends` 配置选项，我们可以继承和使用我们的 TSConfig。

## 总结

通过 tsconfig.json 文件，我们可以配置 TypeScript 编译器的行为，包括编译选项、文件包含与排除规则、输出目录等。合理配置 tsconfig.json 可以帮助我们根据项目需求进行灵活的 TypeScript 编译设置。

详细的 TypeScript 配置文件的参考信息可以在 TypeScript 官方文档中找到：[tsconfig.json](https://www.typescriptlang.org/tsconfig)# 扩展类型定义

在 TypeScript 中，我们可以通过声明文件（`.d.ts` 文件）来为现有的 JavaScript 库提供类型定义，或者为现有的类型添加额外的属性和方法。这个过程通常被称为“类型声明扩展”。在这篇文章中，我们将详细探讨如何通过声明文件扩展类型定义。

## 什么是声明文件？

在 TypeScript 中，声明文件是一种以 `.d.ts` 为扩展名的特殊文件，它不包含具体的实现，只包含类型声明。这些文件通常用来为已有的 JavaScript 库提供类


ATTLE_TEXT_WasntAffected
	waitmessage 64
	goto BattleScript_MoveEnd

BattleScript_CantMakeAsleep: @ 81D6FE0
	pause 32
	printfromtable gUproarAwakeStringIds
	waitmessage 64
	goto BattleScript_MoveEnd

BattleScript_EffectPoisonHit: @ 81D6FF0
BattleScript_EffectPoisonTail: @ 81D6FF0
	setmoveeffect EFFECT_POISON
	goto BattleScript_EffectHit

BattleScript_EffectAbsorb: @ 81D6FFB
	attackcanceler
	accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
	attackstring
	ppreduce
	critcalc
	damagecalc
	typecalc
	adjustnormaldamage
	attackanimation
	waitanimation
	effectivenesssound
	hitanimation TARGET
	waitstate
	healthbarupdate TARGET
	datahpupdate TARGET
	critmessage
	waitmessage 64
	resultmessage
	waitmessage 64
	negativedamage
	orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
	jumpifability TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze
	setbyte cMULTISTRING_CHOOSER, 0
	goto BattleScript_AbsorbUpdateHp

BattleScript_AbsorbLiquidOoze: @ 81D7037
	manipulatedamage 0
	setbyte cMULTISTRING_CHOOSER, 1

BattleScript_AbsorbUpdateHp: @ 81D703F
	healthbarupdate USER
	datahpupdate USER
	jumpifmovehadnoeffect BattleScript_AbsorbTryFainting
	printfromtable gLeechSeedDrainStringIds
	waitmessage 64

BattleScript_AbsorbTryFainting: @ 81D7056
	tryfaintmon USER, FALSE, NULL
	tryfaintmon TARGET, FALSE, NULL
	goto BattleScript_MoveEnd

BattleScript_EffectBlazeKick: @ 81D7069
BattleScript_EffectBurnHit: @ 81D7069
	setmoveeffect EFFECT_BURN
	goto BattleScript_EffectHit

BattleScript_EffectFreezeHit: @ 81D7074
	setmoveeffect EFFECT_FREEZE
	goto BattleScript_EffectHit

BattleScript_EffectParalyzeHit: @ 81D707F
	setmoveeffect EFFECT_PARALYSIS
	goto BattleScript_EffectHit

BattleScript_EffectExplosion: @ 81D708A
	attackcanceler
	attackstring
	ppreduce
	faintifabilitynotdamp
	setatkhptozero
	waitstate
	jumpifbyte NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_1D70A5
	call BattleScript_1D70FB
	goto BattleScript_1D70A7

BattleScript_1D70A5: @ 81D70A5
	attackanimation
	waitanimation

BattleScript_1D70A7: @ 81D70A7
	movevaluescleanup
	critcalc
	damagecalc
	typecalc
	adjustnormaldamage
	accuracycheck BattleScript_1D70E0, ACC_CURR_MOVE
	effectivenesssound
	hitanimation TARGET
	waitstate
	healthbarupdate TARGET
	datahpupdate TARGET
	critmessage
	waitmessage 64
	resultmessage
	waitmessage 64
	tryfaintmon TARGET, FALSE, NULL
	setbyte sMOVEEND_STATE, 0
	moveend 2, 16
	jumpifnexttargetvalid BattleScript_1D70A7
	tryfaintmon USER, FALSE, NULL
	end

BattleScript_1D70E0: @ 81D70E0
	effectivenesssound
	resultmessage
	waitmessage 64
	setbyte sMOVEEND_STATE, 0
	moveend 2, 16
	jumpifnexttargetvalid BattleScript_1D70A7
	tryfaintmon USER, FALSE, NULL
	end

BattleScript_1D70FB: @ 81D70FB
	bicbyte gMoveResultFlag


mic.LoadUint64(&fi.txDropped), atomic.LoadUint64(&fi.txOverruns), atomic.LoadUint64(&fi.txCarrier), atomic.LoadUint64(&fi.txCollision))
}
package handler

import (
	"errors"
	"io"
	"log/slog"
	"net/http"
	"os"
	"regexp"
	"sync"

	"github.com/bytedance/sonic"
	"github.com/gin-gonic/gin"
	"github.com/openai/openai-go"
	"github.com/openai/openai-go/shared/constant"

	"github.com/NexaAI/nexa-sdk/runner/internal/store"
	"github.com/NexaAI/nexa-sdk/runner/internal/types"
	nexa_sdk "github.com/NexaAI/nexa-sdk/runner/nexa-sdk"
	"github.com/NexaAI/nexa-sdk/runner/server/service"
	"github.com/NexaAI/nexa-sdk/runner/server/utils"
)

func Completions(c *gin.Context) {
	c.JSON(http.StatusGone, map[string]any{"error": "this endpoint is deprecated, please use /chat/completions instead"})
}

type ChatCompletionNewParams openai.ChatCompletionNewParams

// ChatCompletionRequest defines the request body for the chat completions API.
// example: { "model": "nexaml/nexaml-models", "messages": [ { "role": "user", "content": "why is the sky blue?" } ] }
type ChatCompletionRequest struct {
	Stream bool `json:"stream"`

	EnableThink       bool    `json:"enable_think"`
	TopK              int32   `json:"top_k"`
	MinP              float32 `json:"min_p"`
	RepetitionPenalty float32 `json:"repetition_penalty"`
	GrammarPath       string  `json:"grammar_path"`
	GrammarString     string  `json:"grammar_string"`
	EnableJson        bool    `json:"enable_json"`

	ChatCompletionNewParams
}

func defaultChatCompletionRequest() ChatCompletionRequest {
	return ChatCompletionRequest{
		Stream:      false,
		EnableThink: true,

		TopK:              0,
		MinP:              0.0,
		RepetitionPenalty: 1.0,
		GrammarPath:       "",
		GrammarString:     "",
		EnableJson:        false,
	}
}

var toolCallRegex = regexp.MustCompile(`<tool_call>([\s\S]+)<\/tool_call>` + "|" + "```json([\\s\\S]+)```")

// @Router			/chat/completions [post]
// @Summary		Creates a model response for the given chat conversation.
// @Description	This endpoint generates a model response for a given conversation, which can include text and images. It supports both single-turn and multi-turn conversations and can be used for various tasks like question answering, code generation, and function calling.
// @Accept			json
// @Param			request	body	ChatCompletionRequest	true	"Chat completion request"
// @Produce		json
// @Success		200	{object}	openai.ChatCompletion	"Successful response for non-streaming requests."
func ChatCompletions(c *gin.Context) {
	param := defaultChatCompletionRequest()
	if err := c.ShouldBindJSON(&param); err != nil {
		c.JSON(http.StatusBadRequest, map[string]any{"error": err.Error()})
		return
	}

	s := store.Get()
	manifest, err := s.GetManifest(param.Model)
	if err != nil {
		c.JSON(http.StatusBadRequest, map


8 0 2.98-1.94 5.51-4.62 6.42-13.07 4.87-26.59 7.34-40.19 7.34C179.67 307.19 128 255.51 128 192c0-63.52 51.67-115.19 115.19-115.19zM380.8 448H96c-19.2 0-32-12.8-32-32s16-32 32-32h284.8v64z"],radiation:[496,512,[],"f7b9","M328.2 255.8h151.6c9.1 0 16.8-7.7 16.2-16.8-5.1-75.8-44.4-142.2-102.5-184.2-7.4-5.3-17.9-2.9-22.7 4.8L290.4 188c22.6 14.3 37.8 39.2 37.8 67.8zm-37.8 67.7c-12.3 7.7-26.8 12.4-42.4 12.4-15.6 0-30-4.7-42.4-12.4L125.2 452c-4.8 7.7-2.4 18.1 5.6 22.4C165.7 493.2 205.6 504 248 504s82.3-10.8 117.2-29.6c8-4.3 10.4-14.8 5.6-22.4l-80.4-128.5zM248 303.8c26.5 0 48-21.5 48-48s-21.5-48-48-48-48 21.5-48 48 21.5 48 48 48zm-231.8-48h151.6c0-28.6 15.2-53.5 37.8-67.7L125.2 59.7c-4.8-7.7-15.3-10.2-22.7-4.8C44.4 96.9 5.1 163.3 0 239.1c-.6 9 7.1 16.7 16.2 16.7z"],"radiation-alt":[496,512,[],"f7ba","M312 256h79.1c9.2 0 16.9-7.7 16-16.8-4.6-43.6-27-81.8-59.5-107.8-7.6-6.1-18.8-4.5-24 3.8L281.9 202c18 11.2 30.1 31.2 30.1 54zm-97.8 54.1L172.4 377c-4.9 7.8-2.4 18.4 5.8 22.5 21.1 10.4 44.7 16.5 69.8 16.5s48.7-6.1 69.9-16.5c8.2-4.1 10.6-14.7 5.8-22.5l-41.8-66.9c-9.8 6.2-21.4 9.9-33.8 9.9s-24.1-3.7-33.9-9.9zM104.9 256H184c0-22.8 12.1-42.8 30.2-54.1l-41.7-66.8c-5.2-8.3-16.4-9.9-24-3.8-32.6 26-54.9 64.2-59.5 107.8-1.1 9.2 6.7 16.9 15.9 16.9zM248 504c137 0 248-111 248-248S385 8 248 8 0 119 0 256s111 248 248 248zm0-432c101.5 0 184 82.5 184 184s-82.5 184-184 184S64 357.5 64 256 146.5 72 248 72zm0 216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32z"],rainbow:[576,512,[],"f75b","M268.3 32.7C115.4 42.9 0 176.9 0 330.2V464c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16


r.Equal(os.Getenv("GOPATH"), Get("GOPATH", "foo"))
	r.Equal("bar", Get("IDONTEXIST", "bar"))
}

func Test_MustGet(t *testing.T) {
	r := require.New(t)
	r.NotZero(os.Getenv("GOPATH"))
	v, err := MustGet("GOPATH")
	r.NoError(err)
	r.Equal(os.Getenv("GOPATH"), v)

	_, err = MustGet("IDONTEXIST")
	r.Error(err)
}

func Test_Set(t *testing.T) {
	r := require.New(t)
	_, err := MustGet("FOO")
	r.Error(err)

	Set("FOO", "foo")
	r.Equal("foo", Get("FOO", "bar"))
}

func Test_MustSet(t *testing.T) {
	r := require.New(t)

	r.Zero(os.Getenv("FOO"))

	err := MustSet("FOO", "BAR")
	r.NoError(err)

	r.Equal("BAR", os.Getenv("FOO"))
}

func Test_Temp(t *testing.T) {
	r := require.New(t)

	_, err := MustGet("BAR")
	r.Error(err)

	Temp(func() {
		Set("BAR", "foo")
		r.Equal("foo", Get("BAR", "bar"))
		_, err = MustGet("BAR")
		r.NoError(err)
	})

	_, err = MustGet("BAR")
	r.Error(err)
}

func Test_GoPath(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		Set("GOPATH", "/foo")
		r.Equal("/foo", GoPath())
	})
}

func Test_GoPaths(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		if runtime.GOOS == "windows" {
			Set("GOPATH", "/foo;/bar")
		} else {
			Set("GOPATH", "/foo:/bar")
		}
		r.Equal([]string{"/foo", "/bar"}, GoPaths())
	})
}

func Test_CurrentModule(t *testing.T) {
	r := require.New(t)
	mod, err := CurrentModule()
	r.NoError(err)
	r.Equal("github.com/gobuffalo/envy", mod)
}

// Env files loading
func Test_LoadEnvLoadsEnvFile(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		r.Equal("root", Get("DIR", ""))
		r.Equal("none", Get("FLAVOUR", ""))
		r.Equal("false", Get("INSIDE_FOLDER", ""))
	})
}

func Test_LoadDefaultEnvWhenNoArgsPassed(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		err := Load()
		r.NoError(err)

		r.Equal("root", Get("DIR", ""))
		r.Equal("none", Get("FLAVOUR", ""))
		r.Equal("false", Get("INSIDE_FOLDER", ""))
	})
}

func Test_DoNotLoadDefaultEnvWhenArgsPassed(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		err := Load("test_env/.env")
		r.NoError(err)

		r.Equal("test_env", Get("DIR", ""))
		r.Equal("none", Get("FLAVOUR", ""))
		r.Equal("true", Get("INSIDE_FOLDER", ""))
	})
}

func Test_OverloadParams(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		err := Load("test_env/.env.test", "test_env/.env.prod")
		r.NoError(err)

		r.Equal("production", Get("FLAVOUR", ""))
	})
}

func Test_ErrorWhenSingleFileLoadDoesNotExist(t *testing.T) {
	r := require.New(t)
	Temp(func() {
		delete(env, "FLAVOUR")
		err := Load


ONFIG_RTL8814A
		case RTL8814A:
		DBG_871X("\nkfree by PhyDM on the sw CH. path %d\n", path);
		break;
#endif /* CONFIG_RTL8821A */

	default:
		rtw_warn_on(1);
		break;
	}

	DBG_871X(" after :0x%x\n", rtw_hal_read_rfreg(adapter, path, 0x55, 0xffffffff));
}

void rtw_rf_apply_tx_gain_offset(_adapter *adapter, u8 ch)
{
	HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
	s8 kfree_offset = 0;
	s8 tx_pwr_track_offset = 0; /* TODO: 8814A should consider tx pwr track when setting tx gain offset */
	s8 total_offset;
	int i;

	for (i = 0; i < hal_data->NumTotalRFPath; i++) {
		kfree_offset = rtw_rf_get_kfree_tx_gain_offset(adapter, i, ch);
		total_offset = kfree_offset + tx_pwr_track_offset;
		rtw_rf_set_tx_gain_offset(adapter, i, total_offset);
	}
}

bool rtw_is_dfs_range(u32 hi, u32 lo)
{
	return rtw_is_range_overlap(hi, lo, 5720 + 10, 5260 - 10)?_TRUE:_FALSE;
}

bool rtw_is_dfs_ch(u8 ch, u8 bw, u8 offset)
{
	u32 hi, lo;

	if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE)
		return _FALSE;

	return rtw_is_dfs_range(hi, lo)?_TRUE:_FALSE;
}

bool rtw_is_long_cac_range(u32 hi, u32 lo)
{
	return rtw_is_range_overlap(hi, lo, 5660 + 10, 5600 - 10)?_TRUE:_FALSE;
}

bool rtw_is_long_cac_ch(u8 ch, u8 bw, u8 offset)
{
	u32 hi, lo;

	if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE)
		return _FALSE;

	return rtw_is_long_cac_range(hi, lo)?_TRUE:_FALSE;
}


"""
Routes that are authenticated against a Clerk user session.
"""

from fastapi import APIRouter, Depends, Request
from pydantic import BaseModel

from activemodel.session_manager import aglobal_session

from ..configuration.clerk import CLERK_PRIVATE_KEY
from .admin import admin_api_app
from .dependencies.clerk import AuthenticateClerkRequest
from .dependencies.login_as import login_as
from .dependencies.user import inject_user_record

# extract into variable for test import to easily override dependencies
authenticate_clerk_request_middleware = AuthenticateClerkRequest(CLERK_PRIVATE_KEY)

authenticated_api_app = APIRouter(
    prefix="/internal/v1",
    # TODO unclear what the tags are used for...
    tags=["private"],
    # think of dependencies as middleware
    dependencies=[
        # NOTE this line could not be more important, look at the underlying implementation!
        Depends(aglobal_session),
        # make sure the user is auth'd via clerk to this endpoint
        Depends(authenticate_clerk_request_middleware),
        # inject a user record into the request state
        Depends(inject_user_record),
        # allow admins to switch to another user
        Depends(login_as),
    ],
)

authenticated_api_app.include_router(admin_api_app)

class AppData(BaseModel, extra="forbid"):
    message: str = "Hello From Internal Python"
    # TODO we should be able to specify TypeID here, but pydantic serializers don't like it
    user_id: str

@authenticated_api_app.get("/")
def application_data(request: Request) -> AppData:
    return AppData(user_id=str(request.state.user.id))


age", awaitItem())

            formController.binding.notifyFieldChange("age")
            assertEquals("age", awaitItem())

            // This should not be received since "name" is not in dependsOn
            formController.binding.notifyFieldChange("name")
            expectNoEvents()

            cancelAndIgnoreRemainingEvents()
        }

        // Test emailController doesn't receive any notifications since it has no dependencies
        emailController.dependentFieldChanges.test {
            // Emit various field changes
            formController.binding.notifyFieldChange("age")
            formController.binding.notifyFieldChange("name")
            formController.binding.notifyFieldChange("email")

            // Should not receive any events since dependsOn is empty
            expectNoEvents()

            cancelAndIgnoreRemainingEvents()
        }
    }

    // Test data class
    data class TestFormData(
        val name: String = "",
        val age: Int = 0,
        val email: String = ""
    )

    // Test adapter for Int <-> String conversion
    private class IntStringAdapter : FieldTypeAdapter<Int, String, String> {
        override fun toValidationTarget(value: Int): String = value.toString()
        override fun toInput(value: Int): String = value.toString()
        override fun fromInput(value: String, current: Int): Int = value.toIntOrNull() ?: current
    }
}
/*
 * Copyright (c) 2019-present Mikhael Sokolov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * 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.
 */
package ru.sokomishalov.skraper.provider.instagram

import org.junit.jupiter.api.Test
import ru.sokomishalov.skraper.model.Image
import ru.sokomishalov.skraper.model.Video
import ru.sokomishalov.skraper.provider.AbstractSkraperTest

/**
 * @author sokomishalov
 */
class InstagramSkraperTest : AbstractSkraperTest() {
    override val skraper = InstagramSkraper(client = client)
    private val username: String = "memes.video"
    private val tag: String = "memes"

    @Test
    fun `Check user posts`() {
        assertPosts { skraper.getUserPosts(username = username) }
    }

    @Test
    fun `Check tag posts`() {
        assertPosts { skraper.getTagPosts(tag = tag) }
    }

    @Test
    fun `Check user info`() {
        assertPageInfo { skraper.getUserInfo(username = username) }
    }

    @Test
    fun `Check tag info`() {
        assertPageInfo { skraper.getTagInfo(tag = tag) }
    }

    @Test
    fun `Check media resolving`() {
        assertMediaResolved(Video("https://www.instagram.com/p/B-flad2F5o7/"))
        assertMediaResolved(Image("https://www.instagram.com/p/B-gwQJelNjs/"))
    }

    @Test
    fun `Check media downloading`() {
        assertMediaDownloaded(Video("https://www.instagram.com/p/B-flad2F5o7/"))
    }
}/*
 * Copyright (c) 2019-present Mikhael Sokolov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the Licen


			['Precision(Accuracy)'] = 'Discordian Alloy of Precision',
			['Rapidity(Attack)'] = 'Discordian Alloy of Rapidity',
			['Annihilation(Spell Damage)'] = 'Focus Shard of Aggregate Annihilation',
			['Lucky Copper/Silver'] = 'Lucky Copper/Lucky Silver/151042/151043',
			['Lucky Grass'] = 'Lucky Grass Trinket/151044',
			['Oculous'] = 'Illuminious Oculus/150980',
			['Mount'] = 'Whirligig Flyer Control Device/Ornate Flying Carpet/39635/39632',
			['DarkArachnids'] = 'Visage of the Dark Arachnids',
			['Lucky Horseshoe'] = 'Luckiest of Horseshoes/150978',
			['War Bear Saddle(Or any other AC Mount)'] = 'War Bear Saddle/39635',
		},
		['Main'] = {
			['Slots'] = {
				{Name='Discordian', Slots={'Annihilation(Spell Damage)','Evasion(Avoidance)','MysticalAegis(DoT Shield)','Precision(Accuracy)','Rapidity(Attack)','Tenacity(Defense)',}},
				{Name='Planar', Slots={'AdeptBlows(Tiger Claw)','BruteForce(Bash)','DexterousStriking(Flying Kick)','EnchantedJewel(Shielding)','EscalatingOnslaught(HStr)','FoulPlay(Backstab)','FuriousAssault(Frenzy)','MysticalAegis(Spell Shield)','Prowess(Offense)','Striking(Kick)'}},
				{Name='Diamond Coins', Slots={'Manastone'}},
				{Name='Gold Coins', Slots={'Dragorn(+ 10 to Wep Skills)','War Bear Saddle(Or any other AC Mount)','DarkArachnids(Does not stack with other Dodge)','WarPirate(Does not stack with Brell)'}},
				{Name='Celestial Crests', Slots={'BloodDrinker','IdolScale','Lucky Copper/Silver','Lucky Grass','Lucky Horseshoe','Mount','Oculous','VenomVial','Bifold',}},
				{Name='Player Made', Slots={'BoarWhistle','SnakeFlute',}},
			}
		}
	},
	['focusitems'] = {
		['Bard'] = {
			['Increased Healing'] = 'Increased Healing/28110',
			['Extended Reach'] = 'Extended Reach/28115',
			['Beneficial Extension'] = 'Beneficial Extension/28113',
			['Beneficial Reduction of Mana'] = 'Beneficial Reduction of Mana/27620',
			['Beneficial Cast Time Reduction'] = 'Beneficial Cast Time Reduction/27622',
			['Detrimental Extension'] = 'Detrimental Extension/28112',
			['Detrimental Reduction of Mana'] = 'Detrimental Reduction of Mana/27618',
			['Detrimental Cast Time Reduction'] = 'Detrimental Cast Time Reduction/27621',
			['Detrimental Damage'] = 'Detrimental Damage/150047',
			['Detrimental Duration Damage'] = 'Detrimental Duration Damage/',
			['Magic Damage'] = 'Magic Damage/28114',
			['Fire Damage'] = 'Fire Damage/27623',
			['Ice Damage'] = 'Ice Damage/27624',
			['Poison Damage'] = 'Poison Damage/27625',
			['Disease Damage'] = 'Disease Damage/28109',
			['Improved Dodge'] = 'Improved Dodge/28119',
			['Block and Parry'] = 'Block and Parry/28118',
			['Cleave'] = 'Cleave/28117',
			['Double Attack'] = 'Double Attack/28116',
		},


_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439, ___m_result_22)); }
	inline bool get_m_result_22() const { return ___m_result_22; }
	inline bool* get_address_of_m_result_22() { return &___m_result_22; }
	inline void set_m_result_22(bool value)
	{
		___m_result_22 = value;
	}
};

struct Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439_StaticFields
{
public:
	// System.Threading.Tasks.TaskFactory`1<TResult> System.Threading.Tasks.Task`1::s_Factory
	TaskFactory_1_t90DBF289FBDBB845B0FA55E1773164F06FBDEA17 * ___s_Factory_23;
	// System.Func`2<System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>,System.Threading.Tasks.Task`1<TResult>> System.Threading.Tasks.Task`1::TaskWhenAnyCast
	Func_2_t185FBBAFD46813778C35A8D4A5FA3AFB4FC0E14C * ___TaskWhenAnyCast_24;

public:
	inline static int32_t get_offset_of_s_Factory_23() { return static_cast<int32_t>(offsetof(Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439_StaticFields, ___s_Factory_23)); }
	inline TaskFactory_1_t90DBF289FBDBB845B0FA55E1773164F06FBDEA17 * get_s_Factory_23() const { return ___s_Factory_23; }
	inline TaskFactory_1_t90DBF289FBDBB845B0FA55E1773164F06FBDEA17 ** get_address_of_s_Factory_23() { return &___s_Factory_23; }
	inline void set_s_Factory_23(TaskFactory_1_t90DBF289FBDBB845B0FA55E1773164F06FBDEA17 * value)
	{
		___s_Factory_23 = value;
		Il2CppCodeGenWriteBarrier((void**)(&___s_Factory_23), (void*)value);
	}

	inline static int32_t get_offset_of_TaskWhenAnyCast_24() { return static_cast<int32_t>(offsetof(Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439_StaticFields, ___TaskWhenAnyCast_24)); }
	inline Func_2_t185FBBAFD46813778C35A8D4A5FA3AFB4FC0E14C * get_TaskWhenAnyCast_24() const { return ___TaskWhenAnyCast_24; }
	inline Func_2_t185FBBAFD46813778C35A8D4A5FA3AFB4FC0E14C ** get_address_of_TaskWhenAnyCast_24() { return &___TaskWhenAnyCast_24; }
	inline void set_TaskWhenAnyCast_24(Func_2_t185FBBAFD46813778C35A8D4A5FA3AFB4FC0E14C * value)
	{
		___TaskWhenAnyCast_24 = value;
		Il2CppCodeGenWriteBarrier((void**)(&___TaskWhenAnyCast_24), (void*)value);
	}
};

// System.Threading.Tasks.Task`1<System.Int32>
struct Task_1_t640F0CBB720BB9CD14B90B7B81624471A9F56D87  : public Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2
{
public:
	// TResult System.Threading.Tasks.Task`1::m_result
	int32_t ___m_re


1");
	});
});
describe("Localized book SgThree (es)", () => {
	let p: InstanceType<typeof bcv_parser>;
	beforeEach(() => {
		p = new bcv_parser();
		p.set_options({book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"});
		p.include_apocrypha(true);
	});
	it("should handle book: SgThree (es)", () => {
		expect(p.parse("El Canto de los Tres Jovenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los Tres Jóvenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los Tres Jovenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los Tres Jóvenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los Tres Jovenes Judios 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los Tres Jovenes Judíos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los Tres Jóvenes Judios 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los Tres Jóvenes Judíos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los Tres Jovenes Judios 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los Tres Jovenes Judíos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los Tres Jóvenes Judios 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los Tres Jóvenes Judíos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("Canto de los Tres Jovenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("Canto de los Tres Jóvenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los 3 Jovenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Canto de los 3 Jóvenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los 3 Jovenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Himno de los 3 Jóvenes Hebreos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("Canto de los Tres Jovenes Judios 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("Canto de los Tres Jovenes Judíos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("Canto de los Tres Jóvenes Judios 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("Canto de los Tres Jóvenes Judíos 1:1").osis()).toEqual("SgThree.1.1");
		expect(p.parse("El Can


(M)RC7(BIOS:D7)

;regs
VAR_DC1             =           $0A
VAR_DC2             =           $0B
VAR_DC3             =           $0C
VAR_DC4         =           $0D
VAR_PSX_TEMP         =           $10
VAR_PSX_BYTE         =           $11
VAR_PATCH_FLAGS      =           $0E
VAR_SWITCH          =           $0F
VAR_BIOS_REV         =           $12
VAR_BIOS_YR          =           $13
VAR_BIOS_REGION_TEMP    =           $14
VAR_PSX_BITC         =           $15
VAR_PSX_BC_CDDVD_TEMP           =           $16

;------------------------------------------------------------
;VAR_PATCH_FLAGS
;------------------------------------------------------------
EJ_FLAG = VAR_PATCH_FLAGS.0
;bit 0 used by eject routine

SOFT_RST = VAR_PATCH_FLAGS.1
;soft reset flag for disk patch

PSX_FLAG = VAR_PATCH_FLAGS.2
;psx mode flag

V10_FLAG = VAR_PATCH_FLAGS.3	;bios 1.9 or 2.0
;also v10 1.9 bios has own ps1 routine

UK_FLAG = VAR_PATCH_FLAGS.4

USA_FLAG = VAR_PATCH_FLAGS.5

JAP_FLAG = VAR_PATCH_FLAGS.6

SCEX_FLAG = VAR_PATCH_FLAGS.7
;set when SCEX_LOW loop for injecting. once cleared knows patching done to flow forward

;------------------------------------------------------------
;VAR_SWITCH
;------------------------------------------------------------
V12_FLAG = VAR_SWITCH.0 ;v12 console 2.0 bios set

V12LOGO_FLAG = VAR_SWITCH.1 ;PS1_MODE v12 2.0 bios console flag ?
;SECOND_BIOS_PATCH_END ref if was doing ps1 patching for 2.0 v12 as redirects flow there for different patch.

X_FLAG = VAR_SWITCH.2
;set when HOLD_BOOT_MODES only clrb when end ?
;can flow onto ps1 reboot into PS1_MODE if detect ps1 media

JAP_V8 = VAR_SWITCH.3

DEV1_FLAG = VAR_SWITCH.4

V14_FLAG = VAR_SWITCH.5
;set due to W for region of BIOS which decka models

;;V0_FLAG = VAR_SWITCH.6		;;

;------------------------------------------------------------
;CODE
;------------------------------------------------------------

;mode setup for io's ;todo
;ref SX-SX-Users-Manual-R3.1.pdf section 5.3.2
                    org           $0FFF							; Reset Vector		;; look at if use extra pages
                    reset         STARTUP						; jmp to startup process on reset vector skipping boot inital

;****** Reset of the chip ********************************
                    org           $0000							; PAGE1 000-1FF
;INTERRUPT
;goes to sleep and wait for reset release ( 1 ) or tray close (0) ...
                    mov           w,#$1f
                    mov           m,w
                    mov           w,#$ff
                    mov           !IO_BIOS_DATA,w
                    mov           w,#$ff
                    mov           !IO_CDDVD_BUS,w
                    mov           w,#$ff
                    mov           !ra,w
                    mov           w,#$1a
                    mov           m,w
                    mov           w,#$8
                    mov           !IO_CDDVD


ape:lineTo(width,0)
	shape:closePath()
	shape:endPath()
	shape:setPosition(x, y)
	Timer.delayedCall(2000, function()
		local tween = GTween.new(ads, 1, {x = x, y = y}, {ease = easing.outBack, dispatchEvents = true})
		tween:addEventListener("complete", function()
			ads:setAlignment("center", "bottom")
		end)
	end)
end)

ads:addEventListener(Event.AD_FAILED, function(e)
	print("ads AD_FAILED", e.error)
end)

ads:addEventListener(Event.AD_ACTION_BEGIN, function()
	print("ads AD_ACTION_BEGIN")
end)

ads:addEventListener(Event.AD_ACTION_END, function()
	print("ads AD_ACTION_END")
end)

ads:addEventListener(Event.AD_DISMISSED, function()
	print("ads AD_DISMISSED")
end)

ads:addEventListener(Event.AD_ERROR, function(e)
	print("ads AD_ERROR", e.error)
end)


        read (0, "    ", "value", entry, stream);
        stream.println ("    return value;");
      }
    stream.println ("  }");
    stream.println ();
    // End of normal read method

    // Per Simon, 8/26/98 - Value helpers get an additional overloaded
    // read method where the value is passed in instead of "new'd" up. This is
    // used for reading parent value state.

    // Per Simon, 3/3/99 - Don't change this "read" for custom marshalling
    stream.println ("  public static void read (org.omg.CORBA.portable.InputStream istream, " + entryName + " value)");
    stream.println ("  {");
    read (0, "    ", "value", entry, stream);
  } // helperRead

  public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
  {
    // First do the state members from concrete parent hierarchy
    Vector vParents = ((ValueEntry) entry).derivedFrom ();
    if (vParents != null && vParents.size() != 0)
    {
      ValueEntry parent = (ValueEntry) vParents.elementAt (0);
      if (parent == null)
        return index;
      // Per Simon, 4/6/99 - call parent read. <d60929>
      if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
          stream.println(indent + Util.helperName (parent, true) + ".read (istream, value);"); // <d60929> // <d61056>
    }

    Vector vMembers = ((ValueEntry) entry).state ();
    int noOfMembers = vMembers == null ? 0 : vMembers.size ();

    for (int k = 0; k < noOfMembers; k++)
    {
      TypedefEntry member = (TypedefEntry)((InterfaceState)vMembers.elementAt (k)).entry;
      String memberName = member.name ();
      SymtabEntry mType = member.type ();

      if (mType instanceof PrimitiveEntry ||
          mType instanceof TypedefEntry   ||
          mType instanceof SequenceEntry  ||
          mType instanceof StringEntry    ||
          !member.arrayInfo ().isEmpty ())
        index = ((JavaGenerator)member.generator ()).read (index, indent, name + '.' + memberName, member, stream);
      else if (mType instanceof ValueEntry)
      {
        String returnType = Util.javaQualifiedName (mType);
        if (mType instanceof ValueBoxEntry)
          // <f46082.51> Remove -stateful.
          //returnType = Util.javaStatefulName (mType);
          returnType = Util.javaName (mType);
        stream.println ("    " + name + '.' + memberName + " = (" + returnType +
                        ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) +  // <d61056>
                        ".get_instance ());"); // <d61056>
      }
      else
        stream.println (indent + name + '.' + memberName + " = " +
                        Util.helperName (mType, true) + ".read (istream);"); // <d61056>
    }

    return index;
  } // read

  public void helperWrite (SymtabEntry entry, PrintWriter stream)
  {
    // <d59418 - KLR> per Simon, make "static" write call istream.write_value.
    //              put real marshalling code in write_value.
    stream.println ("    ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, get_instance());"); // <d60929>
    stream.println ("  }");
    stream.println ();

    // <d62062>
    // per Simon, 4/27/99, add static _write that marshals the state of this
    //  value for non-custom valuetypes
    if (!((ValueEntry)entry).isCustom ())
    {
       stream.println ("


creen: HandledScreen<*>): Sequence<InventoryButton> {
		return DConfig.data.buttons.asSequence().filter { button ->
			button.isValid() && (!TConfig.onlyInv || screen is InventoryScreen)
		}
	}

	@Subscribe
	fun onRectangles(it: HandledScreenPushREIEvent) {
		val bounds = it.screen.getRectangle()
		for (button in getValidButtons(it.screen)) {
			val buttonBounds = button.getBounds(bounds)
			it.block(buttonBounds)
		}
	}

	@Subscribe
	fun onClickScreen(it: HandledScreenClickEvent) {
		val bounds = it.screen.getRectangle()
		for (button in getValidButtons(it.screen)) {
			val buttonBounds = button.getBounds(bounds)
			if (buttonBounds.contains(it.mouseX, it.mouseY)) {
				MC.sendCommand(button.command!! /* non null invariant covered by getValidButtons */)
				break
			}
		}
	}

	var lastHoveredComponent: InventoryButton? = null
	var lastMouseMove = TimeMark.farPast()

	@Subscribe
	fun onRenderForeground(it: HandledScreenForegroundEvent) {
		val bounds = it.screen.getRectangle()

		var hoveredComponent: InventoryButton? = null
		for (button in getValidButtons(it.screen)) {
			val buttonBounds = button.getBounds(bounds)
			it.context.matrices.pushMatrix()
			it.context.matrices.translate(buttonBounds.minX.toFloat(), buttonBounds.minY.toFloat())
			button.render(it.context)
			it.context.matrices.popMatrix()

			if (buttonBounds.contains(it.mouseX, it.mouseY) && TConfig.hoverText && hoveredComponent == null) {
				hoveredComponent = button
				if (lastMouseMove.passedTime() > 0.6.seconds && lastHoveredComponent === button) {
					it.context.drawTooltip(
						MC.font,
						listOf(Text.literal(button.command).gold()),
						buttonBounds.minX - 15,
						buttonBounds.maxY + 20,
					)
				}
			}
		}
		if (hoveredComponent !== lastHoveredComponent)
			lastMouseMove = TimeMark.now()
		lastHoveredComponent = hoveredComponent
		lastRectangle = bounds
	}

	var lastRectangle: Rectangle? = null
	fun openEditor() {
		ScreenUtil.setScreenLater(
			InventoryButtonEditor(
				lastRectangle ?: Rectangle(
					MC.window.scaledWidth / 2 - 88,
					MC.window.scaledHeight / 2 - 83,
					176, 166,
				)
			)
		)
	}
}
package moe.nea.firmament.repo.recipes

import io.github.moulberry.repo.NEURepository
import io.github.moulberry.repo.data.NEUCraftingRecipe
import me.shedaniel.math.Point
import me.shedaniel.math.Rectangle
import net.minecraft.block.Blocks
import net.minecraft.item.ItemStack
import net.minecraft.text.Text
import net.minecraft.util.Identifier
import moe.nea.firmament.Firmament
import moe.nea.firmament.repo.SBItemStack
import moe.nea.firmament.util.tr

object SBCraftingRecipeRenderer : GenericRecipeRenderer<NEUCraftingRecipe> {
	override fun render(
		recipe: NEUCraftingRecipe,
		bounds: Rectangle,
		layouter: RecipeLayouter,
		mainItem: SBItemStack?,
	) {
		val point = Point(bounds.centerX - 58, bounds.centerY - 27)
		val arrow = layouter.createArrow(point.x + 60, point.y + 18)

		if (recipe.extraText != null && recipe.extraText!!.isNotBlank()) {
			layouter.createTooltip(
				arrow,
				Text.of(recipe.extraText!!),
			)
		}

		for (i in 0 until 3) {
			for


IADD3 q, q, param_pad_x, four;
--:-:-:-:1      IADD3 p, p, param_pad_y, four;

[+
    our ($type, $N);
    if ($type eq 'h')
    {
        return q{
--:-:-:-:1      SHL tid31_4, tid_31, 2;

--:-:-:-:1      ISCADD n, n, idxN, 1;

--:-:-:-:1      ISETP.LT.AND P6, PT, tid_31, 16, PT;
        }
    }
    else {
        return q{
--:-:-:-:1      IADD n, n, idxN;
--:-:-:-:1      ISETP.LT.AND P6, PT, n, param_N, PT;
        };
    }
+]

// k = idxK*32 + tid_32<<1
--:-:-:-:1      SHL tid_32, tid_32,   1;
08:-:-:-:1      ISCADD k, idxK, tid_32, 5;

// Out = k*PQN + p*QN + q*N + n
--:-:-:-:1      XMAD.S16.U16      offsetO, q, param_N,    n;
--:-:-:-:1      XMAD.S16.U16.LO2C offsetO, p, param_QN,   offsetO;
--:-:-:-:1      XMAD.U16.U16.LO2C offsetO, k, param_PQN,  offsetO;
--:-:-:-:1      ISET.LT.AND sign, offsetO, RZ, PT;

--:-:-:-:1      LEA    Out0.CC, offsetO, param_O[0], [+ dshift() +];
--:-:-:-:1      IADD.X Out1,    sign,    param_O[1];

--:-:-:-:1      ISETP.EQ.AND P5, PT, RZ, param_flags, PT; // ! no-op

--:-:-:-:1      IADD z1, q, 1;
--:-:-:-:1      IADD z2, q, 2;
--:-:-:-:1      IADD z3, q, 3;
--:-:-:-:1      IADD z4, q, 4;
--:-:-:-:1      IADD z5, q, 5;
--:-:-:-:1      ISETP.LT.AND P0, PT, q,  param_Q, P5;
--:-:-:-:1      ISETP.LT.AND P1, PT, z1, param_Q, P5;
--:-:-:-:1      ISETP.LT.AND P2, PT, z2, param_Q, P5;
--:-:-:-:1      ISETP.LT.AND P3, PT, z3, param_Q, P5;
--:-:-:-:1      ISETP.LT.AND P4, PT, z4, param_Q, P5;
--:-:-:-:1      ISETP.LT.AND P5, PT, z5, param_Q, P5;
--:-:-:-:1      ISETP.GE.AND P0, PT, q,  RZ, P0;
--:-:-:-:1      ISETP.GE.AND P1, PT, z1, RZ, P1;
--:-:-:-:1      ISETP.GE.AND P2, PT, z2, RZ, P2;
--:-:-:-:1      ISETP.GE.AND P3, PT, z3, RZ, P3;
--:-:-:-:1      ISETP.GE.AND P4, PT, z4, RZ, P4;
--:-:-:-:1      ISETP.GE.AND P5, PT, z5, RZ, P5;
--:-:-:-:1      P2R mask_q, PR, RZ, 0x3f;

--:-:-:-:1      IADD z1, p, 1;
--:-:-:-:1      IADD z2, p, 2;
--:-:-


atic T Resolve<T>() where T : notnull
    {
        lock (Lock)
        {
            if (_container is null)
                throw new InvalidOperationException($"IoCContainer must be initialized first [type={nameof(T)}]");
            return _container.Resolve<T>();
        }
    }

    public static T? TryResolve<T>() where T : class
    {
        lock (Lock)
        {
            if (_container is null)
                throw new InvalidOperationException($"IoCContainer must be initialized first [type={nameof(T)}]");
            _ = _container.TryResolve(out T? value);
            return value;
        }
    }

}